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

Re: Rebasing multiple branches

From
EWEnrico Weigelt <weigelt@metux.de>
Date
Dec 22, 2010, 14:36 UTC
Message-ID
<20101222143654.GA4829@nibiru.local>
In-Reply-To
<4D10B44D.5090309@viscovery.net>
* Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 17 quoted lines
> Am 12/21/2010 14:40, schrieb Leonid Podolny:
> >         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,...
> 
> git rebase master A
> git rebase master B
> git merge A
> git rebase -i HEAD C
> 
> The last rebase I propose as interactive so that you can remove those
> commits before D~3 that you have already rebased, because they are likely
> to conflict unnecessarily, and you would --skip them anyway.
Why not this way ?

git checkout D git rebase -p -i D~3 --onto C'

(C' is the merged branch of A' and B').
So:

git checkout branch_A -b rebasing_A git rebase master # rebase old A to master git checkout branch_B -b rebasing_B git rebase master # rebase old B to master git checkout -b rebased_merge git merge rebasing_A # we're on B', merge in A' git checkout branch_C git rebase -p -i C --onto rebased_merge # set D~3..D ontop of it

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Previous: Johannes SixtNext: Leonid Podolny
Message 3 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.