Git merge issue(s)
I’m pretty new to git so I’m still getting my bearings with the tool.
I have a “small” problem involving a merge. Basically the timeline is as follows:
- Did a rebase from SVN using git-svn bridge
- Had conflicts which I merged, but never committed
- Did other work…lots of it and committed a number of other changes
- Tried to push and got “fatal: you have not concluded your merge MERGE_HEAD exists”
- I did a “git reset –merge ORIG_HEAD” as recommended at http://www.btaz.com/scm/git/git-fatal-you-have-not-concluded-your-merge-merge_head-exists/
- Fixed merge issues
- Foolishly committed changes and pushed
Now I realize that a bunch of changes have gone missing in the last merge and I’m wondering how best to undo the merge and get git to allow me to push my changes to origin?
I hope I’ve made the issue clear…if not beat me over the head
2 Solutions collect form web for “Git merge issue(s)”
I’m not clear on exactly how to fix it, but
git reflog is quite a powerful tool. It will show you everything that’s happened to the repo. Then, for example, you can cherry-pick commits from history even if they’re not in the working master branch.
Using the git reflog command previously mentioned find your “lost” commits. You can use git show to review each commit. I would then suggest cherry picking those commits into your current branch with the completed merge one at a time. Obviously you should test as you go (you do have unit tests don’t you? :-). Once you have picked all the commits you are free to push your changes.