In our project, using master and develop branches, a commit has been made directly on master (only three files, and those changes are also on develop branch).
Now I need to merge develop to master, but I cannot since the history for master is now "disjoint" from develop and I get the following error: fatal: refusing to merge unrelated histories
.
I made a reset commit hard
on master as I do not want to retain locally the changes of the last commit as those are already in develop.
However after the revert the local master branch is 600 changes ahead and 1066 behind.
Why such a number of changes? I would expect that the local master branch is not behind at all, as the revert moves the pointer to the previous commit.
Does it count all the previous push/pull made on master branch since the beginning (by doing pull I still get the error fatal: refusing to merge unrelated histories
)?
The expected/desired result would be to go back of one commit on master, when this branch was still on the history line of develop, allowing me to merge the two.