Sunday, May 18, 2014

How to fix GIT error: You have not concluded your merge (MERGE_HEAD exists)

GIT Error message:
You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you can merge.

Cause: Your previous merge was failed to merge automatically and went to conflict state. And you tried to pull again before resolving the conflict.
Solution: Undo the merge and perform the merge again properly.
1) Undo the merge and pull again.
To undo a merge:
git merge --abort [Since git version 1.7.4]
git reset --merge [prior git versions]
2) Resolve the conflict.
3) Don't forget to add and commit the merge.
4) git pull now should work fine.

Please let me know, if it's still not working. Thanks.

Link to my SO post:

1 comment:

  1. I try your suggestions

    $ git merge --abort
    fatal: There is no merge to abort (MERGE_HEAD missing).

    aba@zinger /cygdrive/g/ffmpeg_work/f8/ffmpeg-windows-build-helpers-mas
    $ git reset --merge

    aba@zinger /cygdrive/g/ffmpeg_work/f8/ffmpeg-windows-build-helpers-mas
    $ git pull --force
    error: Your local changes to the following files would be overwritten
    Please, commit your changes or stash them before you can merge.

    so how do I solve this ?