Git development
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Avery Pennarun <apenwarr@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git rebase to move a batch of patches onto the current branch
Date: Fri, 25 Jul 2008 22:31:18 +0200	[thread overview]
Message-ID: <20080725203118.GA28937@atjola.homenet> (raw)
In-Reply-To: <32541b130807241257j7820a591if8ca01c66bbcd6b2@mail.gmail.com>

On 2008.07.24 15:57:03 -0400, Avery Pennarun wrote:
> Hi,
> 
> I often find myself being on a branch and wanting to do the equivalent
> of a series of cherry-picks from another branch into the current one.
> Unfortunately, "git cherry-pick" only does one patch at a time (which
> is very tedious), and "git rebase", which is much less tedious to use,
> seems to specializing in applying your current branch on top of
> another branch, not the other way around.
> 
> Currently I do something like this:
> 
>       git checkout -b tmp branch_with_interesting_stuff~5
>       git rebase --onto mybranch branch_with_interesting_stuff~15
>       git branch -d mybranch
>       git branch -m tmp mybranch
> 
> But it seems a little complex when what I *really* want to type is
> something like:
> 
>       git cherry-pick
> branch_with_interesting_stuff~15..branch_with_interesting_stuff~5
> 
> and have it give me a rebase-style UI in case of conflicts, etc.  And
> of course, even more bonus points if I can get "rebase -i"
> functionality.

For "rebase -i", this should do:

git checkout mybranch
git reset --hard interesting_stuff~5
git rebase -i --onto ORIG_HEAD interesting_stuff~5

Not as nice as the format-patch thing but at least it doesn't drop your
braches' reflog like your version, and it provides "rebase -i"
functionality.

Note that the ORIG_HEAD thing might require a recent git version, IIRC
there were some patches to make rebase correctly handle that.

Björn

      parent reply	other threads:[~2008-07-25 20:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-24 19:57 git rebase to move a batch of patches onto the current branch Avery Pennarun
2008-07-24 20:13 ` Alex Riesen
2008-07-24 20:16   ` Avery Pennarun
2008-07-24 20:30     ` Alex Riesen
2008-07-24 20:42       ` Avery Pennarun
2008-07-25 19:16         ` Daniel Barkalow
2008-07-25 19:25           ` Stephan Beyer
2008-07-25 20:00             ` Alex Riesen
2008-07-25 20:31 ` Björn Steinbrink [this message]

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=20080725203118.GA28937@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=apenwarr@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