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

Re: Need some help with git rebase

From
Sylvain Rabot <sylvain@abstraction.fr>
Date
Dec 31, 2009, 09:02 UTC
Message-ID
<7fce93be0912310102x53755120o31e42c4a7a92a709@mail.gmail.com>
In-Reply-To
<CB5B49CA-0C66-4384-9B47-3675E517E203@wincent.com>
On Wed, Dec 30, 2009 at 23:46, Wincent Colaiuta <win@wincent.com> wrote:
Show 20 quoted lines
>
> Look at the "git-rebase" man page, particularly the order of the arguments, what they mean, and the usage examples of "--onto":
>
>  $ git rebase --onto 12.72.1 master feature
>
> Means, "replay these changes on top of 12.72.1", where "these changes" refers to commits on branch "feature" with upstream "master", which is what "git rebase" did for you.
>
> If you actually want the "feature" branch to continue pointing at the old feature branch rather than your newly rebased one, you could just look up the old SHA1 for it and update it with:
>
>  $ git branch -f feature abcd1234
>
> Where "abcd1234" is the hash of the old "feature" HEAD.
>
> But I don't really know why you'd want to do that. The purpose of "git rebase" isn't to copy or cherry-pick commits from one branch onto another, but to actually _move_ (or transplant, or replay, if you prefer) those commits.
>
> Maybe I misunderstood your intentions though.
>
> Cheers,
> Wincent
>

In fact I want to backport the commits of the feature branch into 12.72.1. I used git rebase because the drawings of the man page looked like that I wanted to do and it does except for the part it resets the head of my feature branch.

But the good behavior would be to cherry pick each commit of the feature branch and apply them into 12.72.1, right ?

Thanks for your answer.
Regards.

-- Sylvain

Previous: Wincent ColaiutaNext: Peter Baumann
Message 4 of 7 in “Need some help with git rebase”
  1. Sylvain RABOTDec 28, 2009
  2. Sylvain RabotDec 30, 2009
  3. Wincent ColaiutaDec 30, 2009
  4. Sylvain RabotDec 31, 2009
  5. Peter BaumannDec 31, 2009
  6. Tay Ray ChuanDec 31, 2009
  7. Wincent ColaiutaDec 31, 2009

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.