From: Jay Soffian Date: Fri, 18 Jun 2010 04:38:16 GMT Subject: Re: rebasing a merge Message-ID: In-Reply-To: On Thu, Jun 17, 2010 at 11:51 AM, Jay Soffian wrote: > 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 This is a bit more efficient: mc=$(git rev-parse HEAD) p1=$(git rev-parse origin) p2=$(git rev-parse HEAD^2) git merge origin || exit 0 tree=$(git log -1 HEAD --pretty=%T) git reset --hard $(git cat-file commit $mc | sed '1,/^$/d' | git commit-tree $tree -p $p1 -p $p2)