Re: Moving commits from one branch to another (improving my git fu!)

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

 



On Tue, Oct 22, 2013 at 11:30 AM, Bryan Turner <bturner@xxxxxxxxxxxxx> wrote:
> A quick glance at your command line and the man page for git rebase
> suggests the problem was you didn't actually use --onto. I believe the
> correct command would be:
>
> git rebase --onto dev stable topicA

Yes, thats the cmd I gave. (missed typing onto in the mail though)
>
>
> That should start by determining which commits are one topicA but not
> stable and then checkout dev and apply those new commits.

Thats what I expected too. There are only 2 commits that were made in
topicA. So I was expecting it to pick those 2 and apply them on the
dev branch. But instead it's applying a LOT of commits on dev.
Remember that 'dev' is very different from 'stable'.

As suggested, maybe cherry-pciking is what I need to do.

Thanks,
-mandeep


>
>
> Hope this helps,
> Bryan Turner
>
> On 22 October 2013 16:38, Mandeep Sandhu <mandeepsandhu.chd@xxxxxxxxx> wrote:
>> Hi All,
>>
>> I'm in a bit of a pickle! :) So I've come to ask for help from the guru's here.
>>
>> My story is not unique but somehow the various suggested solutions
>> don't seem to work in my case.
>>
>> * I was working on a feature which was supposed to be done off our
>> 'dev' branch. But instead I forgot and branched out my topic branch
>> from master (or as we call it 'stable').
>> * I did 2 commits and finished off my work. Only later realizing that
>> it had to be done off 'dev'.
>> * Now I want to move my 2 commits (which are the top 2 commits on my
>> topic branch) to a new branch which is branched off 'dev'.
>>
>> $ git branch
>> * topicA
>> * stable
>> * dev
>>
>> topicA was based on stable. But now I want to base it dev.
>>
>> So I did what was most suggested, i.e use 'git rebase --onto'.
>>
>> Here's what I did when I was in topicA:
>>
>> $ git rebase dev stable topicA
>> (this was suggested in the manpage as well).
>>
>> This started off a massive rebase operation, because the 'dev' branch
>> is vastly diverged from stable, and a lot of conflicts started
>> appearing.
>>
>> I'm not sure if I'm doing it right here, so can anyone suggest whether
>> this is right or do I need to do it differently?
>>
>> PS: Please CC me (mandeepsandhu.chd@xxxxxxxxx) in your reply as I'm
>> not currently subscribed to the list.
>>
>> Thanks for your time.
>>
>> Regards,
>> -mandeep
>> --
>> 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
--
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]