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

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

 



Mandeep Sandhu:

Here's what I did when I was in topicA:

$ 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.

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.

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

--
\\// 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]