Wednesday, August 18, 2010

Git: You have not concluded your merge (MERGE_HEAD exists).

Recently when attempting to do a 'git pull' on a remote repository, I encountered a CONFLICT which required resolution. After addressing this conflict, I added my changes via 'git add' and attempted to pull from the remote repository again. The following message was seen:

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


I found a solution here which simply stated to revert the merge 'git reset --merge ORIG_HEAD' and try again. The step I missed was the 'git commit' after the 'git add' before retrying the pull.

The commit should have been obvious except that I had just run through a series of conflict resolutions while doing a 'git rebase' against the master branch. During a rebase, it is expected for you to resolve the conflicts, 'git add', and then continue with 'git rebase --continue'. There is no commit step when resolving conflicts during a rebase.

A classic case of wrong frame of mind.

No comments:

Post a Comment

Comments?