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

Re: Can't get git rebase --onto to work

From
Howard Miller <howard@e-learndesign.co.uk>
Date
Jun 2, 2011, 10:38 UTC
Message-ID
<BANLkTikTi7nryTsyNV5incW3TxaOROyzMw@mail.gmail.com>
In-Reply-To
<20110602103259.GA30081@centaur.lab.cmartin.tk>
On 2 June 2011 11:32, Carlos Martín Nieto <carlos@cmartin.tk> wrote:
Show 29 quoted lines
> On Thu, Jun 02, 2011 at 11:17:41AM +0100, Howard Miller wrote:
>> Trying to explain this as concisely as possible.
>>
>> I started with the following branches (names changed to protect the guilty)...
>>
>> * clientA
>> * clientB
>>
>> both have a common ancestry....
>>
>> I then checked out clientB created a new branch clientB_patch and did
>> a load of work and commits.
>>
>> However, I actually wanted all those commits to apply to clientA
>> branch instead so....
>>
>> git checkout clientA
>> git checkout -b clientA_patch     (to ensure I didn't wreck original branch)
>> git rebase --onto clientA_patch clientB clientB_patch
>
> The man page for git-rebase covers this exact situation (around line
> 88 in my version) . In its case, it's
>
>    git rebase --onto master next topic
>
> which translates to your case as
>
>    git rebase --onto clientA clientB clientB_patch
>

Thanks. That's what I said (except I added an extra branch onto ClientA because I interpreted the instructions - wrongly - to say that ClientA would change).

However, I've just realised the bit I missed. I still need to do a (fast forward) merge to get my ClientA_patch branch to actually reflect the changes. I can't help thinking that (although the diagrams are perfectly correct) that a line to the effect in the manpage might have saved some thinking time :)

Previous: Carlos Martín NietoNext: Tim Guirgies
Message 3 of 10 in “Can't get git rebase --onto to work”
  1. Howard MillerJun 2, 2011
  2. Carlos Martín NietoJun 2, 2011
  3. Howard MillerJun 2, 2011
  4. Tim GuirgiesJun 2, 2011
  5. Howard MillerJun 2, 2011
  6. Tim GuirgiesJun 2, 2011
  7. Howard MillerJun 2, 2011
  8. DavidJun 2, 2011
  9. Tim GuirgiesJun 2, 2011
  10. Howard MillerJun 2, 2011

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.