Re: rebasing a merge
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Jun 18, 2010, 04:38 UTC
- Message-ID
- <AANLkTimyqTOhkeDIMLwgw3iuN0IkDDquPi1tMV5WKoNc@mail.gmail.com>
- In-Reply-To
- <AANLkTilY_9j2sXlplhYB4FPAIAzuPBg2UyUTEk4DaaYF@mail.gmail.com>
On Thu, Jun 17, 2010 at 11:51 AM, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 8 quoted lines
> 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)