Git development
 help / color / mirror / Atom feed
From: Peter Krefting <peter@softwolves.pp.se>
To: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Moving commits from one branch to another (improving my git fu!)
Date: Tue, 22 Oct 2013 06:52:50 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.00.1310220647400.13299@ds9.cixit.se> (raw)
In-Reply-To: <CAC+QLdSjTjftgUBy-1cHbATZnX-UO3PavUaLwErhCaxBa-hPmQ@mail.gmail.com>

Mandeep Sandhu:

> Here's what I did when I was in topicA:
>
> $ git rebase dev stable topicA
> (this was suggested in the manpage as well).

I guess you also had an "--onto" in there, as the above would throw a 
syntax error. As long as the branches are in order, I cannot see how 
that wouldn't do what you wanted.

However, the easiest way to do it would probably just to run:

  git checkout topicA
  git rebase dev

As long as "dev" already contains all the commits in "stable", that 
should work fine. If not, then you would need something more 
complicated.

Another way to do it would be to use cherry-pick on a new branch:

  git checkout -b new_topicA dev
  git cherry-pick stable..topicA

-- 
\\// Peter - http://www.softwolves.pp.se/

  reply	other threads:[~2013-10-22  6:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-22  5:38 Moving commits from one branch to another (improving my git fu!) Mandeep Sandhu
2013-10-22  5:52 ` Peter Krefting [this message]
2013-10-22  6:11   ` Mandeep Sandhu
2013-10-22  6:00 ` Bryan Turner
2013-10-22  6:15   ` Mandeep Sandhu
2013-10-22 12:42 ` Noufal Ibrahim
2013-10-22 12:51   ` Mandeep Sandhu

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=alpine.DEB.2.00.1310220647400.13299@ds9.cixit.se \
    --to=peter@softwolves.pp.se \
    --cc=git@vger.kernel.org \
    --cc=mandeepsandhu.chd@gmail.com \
    /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