git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Peter Baumann <waste.manager@gmx.de>
To: Chris Frey <cdfrey@foursquare.net>
Cc: Peter Krefting <peter@softwolves.pp.se>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Rebasing a merged branch
Date: Sat, 10 Jul 2010 09:19:55 +0200	[thread overview]
Message-ID: <20100710071955.GA12251@m62s10.vlinux.de> (raw)
In-Reply-To: <20100710065541.GB15600@foursquare.net>

On Sat, Jul 10, 2010 at 02:55:41AM -0400, Chris Frey wrote:
> On Thu, Jul 08, 2010 at 12:52:08PM +0100, Peter Krefting wrote:
> > Hi!
> > 
> > If I slightly modify the example from the git-rebase manual page to look 
> > like this:
> > 
> >   o---o---o---o  master
> >          \
> >           o---o---o---o---o  topicA
> >            \     /
> >             A---B---C---D  topicB
> > 
> > (topicA has merged "B" into its history; its first-parent from the line of 
> > "o"s).
> > 
> > If I now do a "git rebase --onto master topicA topicB", I only get commit C 
> > and D, as it sees A and B as being part of both branches.
> > 
> > Is there a way to make git rebase pick up A, B, C and D (and only them)?
> > 
> > I.e., I would like "all commits on topicB which are not in topicA's 
> > --first-parent history".
> 
> 
> I'm no expert on rebase --onto, but aren't you trying to rebase so that
> the tree looks like this afterward?
> 
> 
>    o---o---o---o  master
>             \   \
>              \   A---B---C---D  topicB
>               \
>                o---o---o---o---o  topicA
>                 \     /
>                  A---B
>  
> In which case, won't this work?
> 
> 	git checkout topicB
> 	git rebase master
> 
> - Chris

No, this won't work. You will also rebase A^ (the o) commit in both branches
A and B.

AFAIK doing the following should do the trick:

git checkout topicB
git rebase --onto master A~1 topicB

      reply	other threads:[~2010-07-10  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-08 11:52 Rebasing a merged branch Peter Krefting
2010-07-10  6:55 ` Chris Frey
2010-07-10  7:19   ` Peter Baumann [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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20100710071955.GA12251@m62s10.vlinux.de \
    --to=waste.manager@gmx.de \
    --cc=cdfrey@foursquare.net \
    --cc=git@vger.kernel.org \
    --cc=peter@softwolves.pp.se \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).