Feb 04 2010
fatal: You have not concluded your merge. (MERGE_HEAD exists)
I got this message because when I performed a “git pull”. I searched for a solution for this problem on the Internet and it wasn’t until I found this post that I was able to resolve this issue. The problem was that I:
- Performed a “git pull” and the automatic merge failed and I ended up with merge conflicts
- I resolved the merge conflicts and added the resolved files back using “git add”
- Performed a new “git pull” and got the “Fatal You Have not Concluded Your Merge MERGE_HEAD Exists” error
Apparently step 3 overrides MERGE_HEAD, starting a new merge with a dirty index. According to the post this is a common mistake made by programmers that are used to version control systems where the user follows an “update” and “commit” work flow.
So how do we resolve this issue? What worked for me was to follow the instructions for how to “Undo a merge or pull inside a dirty work tree” found here.
- I used “git reset –merge ORIG_HEAD”
- I resolved the merge conflicts again and added the resolved files back using “git add”
- I was then finally able to “push” my changes!
According to the documentation if you run a “git reset –hard ORIG_HEAD” it will let you go back to where you were before you were trying to commit your changes, however you will lose local changes. Most likely not what you want to do. Using “git reset –merge” will let you keep your local changes. You will however have to re-resolve your conflicting merge files.
Some additional information on this topic can be found here.
11 responses so far