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

Re: Rebasing multiple branches at once

From
Jeff King <peff@peff.net>
Date
Jan 2, 2017, 06:42 UTC
Message-ID
<20170102064214.5fvjyv54c7wbrk2i@sigill.intra.peff.net>
In-Reply-To
<xmqqmvfb4i5a.fsf@gitster.mtv.corp.google.com>
On Sat, Dec 31, 2016 at 06:40:33PM -0800, Junio C Hamano wrote:
Show 23 quoted lines
> What people seem to do is to teach the branch that ends with F that
> its upstream is the local branch that ends with E, so that they can
> be lazy when rebasing a branch that knows its upstream.  I suspect
> that you would end up with
> 
> A---G---B'--C'--D'--E'--F'
> 
> instead if it is done naively, but if you really care that the
> branch that ends with F does not have E, you presumably want to have
> the branch that ends at D its own identity, so
> 
>  (1) 'master' or whatever that used to end at A and now its tip is
>      at G;
> 
>  (2) the branch that ends at D whose upstream is 'master';
> 
>  (3) the branch that ends at E whose upstream is (2); and
> 
>  (4) the branch that ends at F whose upstream is (2).
> 
> I personally do not do that, though, because you'd need to remember
> the order in which these three branches must be rebased (i.e. (2)
> must be done first before rebasing (3) and (4) in any order).

I do occasionally have dependent topics, and use a topological sort to order my rebases, which solves the problem. The code I use is in:

  https://github.com/peff/git/blob/meta/rebase
-Peff
Previous: Junio C HamanoNext: Johannes Sixt
Message 3 of 4 in “Rebasing multiple branches at once”
  1. Mike HommeyDec 31, 2016
  2. Junio C HamanoJan 1, 2017
  3. Jeff KingJan 2, 2017
  4. Johannes SixtJan 1, 2017

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.