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

Re: Moving a branch to a different node

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Jun 6, 2010, 22:19 UTC
Message-ID
<m2hblfregz.fsf@igel.home>
In-Reply-To
<C831D94B.1D9DF%mikesol@ufl.edu>
Mike Solomon <mikesol@UFL.EDU> writes:
Show 18 quoted lines
> Hey git users,
>     I am working on a project where I proceeded by the following steps:
>
> starting from master...
> 1) create branch foo
> 2) work in foo, make some commits, then a patch named Foo
> 3) create a branch bar while in foo
> 4) work in bar, make some commits, then a patch named Bar
>
> git show-branch gives me
>
> ! [master] Hello
>  * [foo] Foo
>   ! [bar] Bar
>
> I would like to make bar split off of master instead of foo so that I can
> format a patch that can be applied to master (Bar) without having to first
> apply Foo.  Is there a way to do that?

IIUC you want to rebase the commits in bar that are not in foo onto master.

$ git rebase --onto master foo bar
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Taylor Hedberg
Message 3 of 3 in “Moving a branch to a different node”
  1. Mike SolomonJun 6, 2010
  2. Taylor HedbergJun 6, 2010
  3. Andreas SchwabJun 6, 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.