This is the situation I have been faced with. I have 3 branches.
1. Master
2. Development
3. Release candidate branch
Feature development is done and so the standard practice is checking out a release branch. Therefore any new bugs raised will be fixed there. Another standard procedure is that we have to release only from the release branch but at this point in time, only the release branch has the latest code. Ofcourse we know that Master has stable code but its not upto date. For one reason or another there is a merge conflict. How do I solve this in the most efficient way possible.
My objective is very simple, get master’s tip to the same level as Release.
1. So first I revert to the original revision where master didnt have a merge conflict by running the command
git reset --hard
2. The I the master branch with the release branch with the commands.
git fetch --all git reset --hard origin/release{or whatever branch name you have}
The guys at stackoverflow had more of this discussion, where most of them agreed on the answer as given in the link below.
http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull#answer-8888015