From: Avery Pennarun <apenwarr@gmail.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Dealing with an upstream cherry-picked branch
Date: Mon, 15 Mar 2010 19:39:41 -0400 [thread overview]
Message-ID: <32541b131003151639o173669a7v4b3b4c13bc7e153@mail.gmail.com> (raw)
In-Reply-To: <76718491003151407p3cdecf8fx1ddebf19ce304f83@mail.gmail.com>
On Mon, Mar 15, 2010 at 4:07 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
> On Mon, Mar 15, 2010 at 2:46 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
>>> Jay Soffian wrote:
>>> (c) Create a new branch at point Ma and cherry-pick only the local
>>> commits from local-master past point Ma. This essentially gives me the
>>> clean local-master I would've had if I'd been doing (1) all along.
>>
>> This will work, but the short form for exactly the same operation is:
>>
>> git checkout -b local-b local-master
>> git rebase --onto upstream-master upstream-a
>
> Are you sure that will skip the merges into local-master from
> upstream-a? I didn't think so and it's not my recollection based on
> using --onto previously.
It should. The --onto option is rather confusing to get right, and
because git is pretty smart, sometimes the rebase will end up doing
what you want (maybe with some extra conflicts) *despite* using the
wrong (or no) --onto option.
Basically, the 'upstream-a' option above means "remove everything
that's in upstream-a" and then the --onto option means "and then paste
what's left on top of upstream-master". Since your merge commits only
add things from upstream-a, they too should be left out of the rebase.
Sometimes I find this gets confusing. You can often sort it out by
using 'rebase -i' (with otherwise the same options as above) and
tweaking it a little. But the upstream-a commits should definitely
all be gone.
Have fun,
Avery
next prev parent reply other threads:[~2010-03-15 23:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 4:17 Dealing with an upstream cherry-picked branch Jay Soffian
2010-03-15 18:46 ` Avery Pennarun
2010-03-15 21:07 ` Jay Soffian
2010-03-15 23:39 ` Avery Pennarun [this message]
2010-03-15 21:30 ` Junio C Hamano
2010-03-16 17:38 ` Jay Soffian
2010-03-16 22:56 ` Junio C Hamano
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=32541b131003151639o173669a7v4b3b4c13bc7e153@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=jaysoffian@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;
as well as URLs for NNTP newsgroup(s).