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

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

 



>> $ git rebase dev stable topicA
>> (this was suggested in the manpage as well).
>
>
> I guess you also had an "--onto" in there, as the above would throw a syntax
> error. As long as the branches are in order, I cannot see how that wouldn't
> do what you wanted.

Yes, you're right. There was "--onto" there.

The only problem is that there were a LOT of conflicts when I ran this
cmd in places which have nothing to do with my commit. And as I said,
dev is vastly different from stable.

>
> However, the easiest way to do it would probably just to run:
>
>  git checkout topicA
>  git rebase dev
>
> As long as "dev" already contains all the commits in "stable", that should
> work fine. If not, then you would need something more complicated.

I don't think thats the case currently. People commit bug-fixes to
'stable' (from which a release will be made later) and all new and
experimental stuff is tried on 'dev'. So there's a lot in 'dev' that's
not there in 'stable'.

>
> Another way to do it would be to use cherry-pick on a new branch:
>
>  git checkout -b new_topicA dev
>  git cherry-pick stable..topicA

Hmmm...this looks safe to do. If I do "git log stable..topicA" it
should only show my commits made on top of stable, right? Or I can
even mention the commit SHA here?

Thanks,
-mandeep

>
> --
> \\// Peter - http://www.softwolves.pp.se/
--
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]