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

Coping commits from one branch to another

From
Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
Date
Jan 22, 2008, 15:45 UTC
Message-ID
<8e04b5820801220745m3736686exf631f31c9e6d785a@mail.gmail.com>
    Hello all!
    My question is how can I use git-rebase -- or a similar command --
to actually copy the commits from one branch to another.
    For example I have cloned the linux kernel repository and I have
the following branches:
    -- v2.6.22-stable
    -- v2.6.23-local
    -- v2.6.23-stable
    -- v2.6.23-local
    The difference between v2.6.x-stable and v2.6.x-local are just a
few minor patches (which are not in the default kernel tree) and some
script files added to make the compilation and deployment easier for
my setup. Thus v2.6.x-local is an ancestor of v2.6.x-stable. Now when
v2.6.24 will arrive I would like to "copy" the commits from
v2.6.23-local to v2.6.24-local.
    One solution would be to use:
    git rebase --onto v2.6.24-local v2.6.23-stable v2.6.23-local
    But this will not copy the commits, but actually move them. (And I
do not see anything about this case in the git rebase documentation,
or pointers to other commands similar to rebase.)
    So how should this be done?
    Thanks,
    Ciprian Craciun.
    P.S.: The simplest solution would be to obtain the list of commits
and apply them with cherry-pick... But this is not that straight
forward...
Next: Johannes Schindelin
Message 1 of 3 in “Coping commits from one branch to another”
  1. Ciprian Dorin CraciunJan 22, 2008
  2. Johannes SchindelinJan 22, 2008
  3. Johan HerlandJan 22, 2008

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.