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.
Steps:
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: http://stackoverflow.com/a/11647899/1365319

2 comments:

  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
    _msvc/unit_test/unit_test.vcxproj
    _msvc/unit_test/unit_test.vcxproj.filters
    Please, commit your changes or stash them before you can merge.
    Aborting

    so how do I solve this ?

    ReplyDelete
  2. I would suggest to read detailed article on below link, i was helpful to me.

    https://www.askforprogram.in/2019/05/you-have-not-concluded-your-merge-merge-head-exists-sourcetree-git.html

    ReplyDelete