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

rebasing a merge

From
Jay Soffian <jaysoffian@gmail.com>
Date
Jun 17, 2010, 15:51 UTC
Message-ID
<AANLkTilY_9j2sXlplhYB4FPAIAzuPBg2UyUTEk4DaaYF@mail.gmail.com>
Say you have:
-o--o--o--m master
         /
--o--o--o   side
You're ready to push the merge, but in the mean time:
         o--o--o origin/master
        /
-o--o--o--m master
         /
--o--o--o   side

For 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.
Next: Jay Soffian
Message 1 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.