Say you have:
-o--o--o--m master
/
--o--o--o sideYou're ready to push the merge, but in the mean time:
o--o--o origin/master
/
-o--o--o--m master
/
--o--o--o sideFor various reasons, when this happens I want to rebase my merge (m). It is almost always a merge that involves a fair amount of conflict resolution. Here's how I've been doing it, but I'll bet there's a less convoluted way:
git merge origin/master # resolve as needed git branch -f temp # save the tree git reset --hard ORIG_HEAD # restore back to the merge git rebase -i -p --onto origin/master HEAD~1 # rebase the merge git checkout temp -- . # resolve the conflict here git rebase --continue # commit the resolution git diff temp # no differences git branch -D temp
Thoughts?
j.