Feb 04 2010

GIT Fatal You Have not Concluded Your Merge MERGE_HEAD Exists

Published by michael at 11:23 pm under GIT

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:

  1. Performed a “git pull” and the automatic merge failed and I ended up with merge conflicts
  2. I resolved the merge conflicts and added the resolved files back using “git add”
  3. 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.

  1. I used “git reset –merge ORIG_HEAD”
  2. I resolved the merge conflicts again and added the resolved files back using “git add”
  3. 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.

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

Related posts:

  1. fatal: git checkout: updating paths is incompatible with switching branches. Using GIT I tried to pull down a new remote...

5 responses so far

5 Responses to “GIT Fatal You Have not Concluded Your Merge MERGE_HEAD Exists”

  1. Evanon 01 Mar 2010 at 9:18 pm

    FYI, for anyone else who stumbles across this page like I did (by searching that error message): All I needed to do was commit.

  2. michaelon 02 Mar 2010 at 12:42 pm

    That’s interesting and I’m glad it worked for you. In my case it wouldn’t even let me commit.

  3. Willon 02 Mar 2010 at 5:58 pm

    It wouldn’t let me commit either until I did a git add on the file I had to manually merge.

  4. michaelon 04 Mar 2010 at 9:39 am

    Yeah that makes sense. Unfortunately for me even after that it wouldn’t let me commit. I like GIT but there are a few gotchas for sure.

  5. Trevoron 27 Apr 2010 at 1:29 am

    I had a conflict with several files, which I fixed. Then I got this warning and I did as evan said for each file:
    git commit -a
    then I tried to pull from the other directory again and found everything was “up-to-date”

Trackback URI | Comments RSS

Leave a Reply