Re: Dealing with an upstream cherry-picked branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 15, 2010 at 4:07 PM, Jay Soffian <jaysoffian@xxxxxxxxx> wrote:
> On Mon, Mar 15, 2010 at 2:46 PM, Avery Pennarun <apenwarr@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]