git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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)

Previous: Jay SoffianNext: Peter Krefting
Message 2 of 6 in “rebasing a merge”
  1. Jay SoffianJun 17, 2010
  2. Jay SoffianJun 18, 2010
  3. Peter KreftingJun 18, 2010
  4. Jay SoffianJun 18, 2010
  5. Peter KreftingJun 24, 2010
  6. Jay SoffianJun 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.