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

Rebasing multiple branches

From
LPLeonid Podolny <leonidp.lists@gmail.com>
Date
Dec 21, 2010, 13:40 UTC
Message-ID
<4D10AE5B.2080700@gmail.com>

Hi, I need to rebase a rather complicated formation of branches.

My situation is like this (I hope ASCII graphics survive the sending):
         B--o--o--o--o--o--o  <--branch A
        /                   \
o--o--A--o--E  <--master    C--o--o--o--D  <--branch C
        \                   /
         C--o--o--o--o--o--o  <--branch B
I would like to rebase all three branches A, B and C onto commit E, and 
it's very important to keep the information about merges. For instance, 
if I take commit C and rebase it onto D, it serializes all the 
intermediate commits.
The only solution I managed to come up with is as follows:
- Take branch A and rebase it onto D (branch A').
- Same with branch B.
- Open a new branch C' from commit E.
- Merge A' and B' into C'.
- Manually cherry-pick all commits from commit C to commit D into branch C'.
The last step is way too ugly to be the only possible solution :)
Next: Johannes Sixt
Message 1 of 6 in “Rebasing multiple branches”
  1. Leonid PodolnyDec 21, 2010
  2. Johannes SixtDec 21, 2010
  3. Enrico WeigeltDec 22, 2010
  4. Leonid PodolnyDec 22, 2010
  5. Enrico WeigeltDec 30, 2010
  6. Thomas RastDec 31, 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.