git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ciprian Dorin Craciun" <ciprian.craciun@gmail.com>
To: git@vger.kernel.org
Subject: Coping commits from one branch to another
Date: Tue, 22 Jan 2008 17:45:18 +0200	[thread overview]
Message-ID: <8e04b5820801220745m3736686exf631f31c9e6d785a@mail.gmail.com> (raw)

    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...

             reply	other threads:[~2008-01-22 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 15:45 Ciprian Dorin Craciun [this message]
2008-01-22 16:03 ` Coping commits from one branch to another Johannes Schindelin
2008-01-22 16:07 ` Johan Herland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e04b5820801220745m3736686exf631f31c9e6d785a@mail.gmail.com \
    --to=ciprian.craciun@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).