Re: Moving commits from one branch to another (improving my git fu!)
- From
Peter Krefting <peter@softwolves.pp.se>
- Date
- Oct 22, 2013, 05:52 UTC
- Message-ID
- <alpine.DEB.2.00.1310220647400.13299@ds9.cixit.se>
- In-Reply-To
- <CAC+QLdSjTjftgUBy-1cHbATZnX-UO3PavUaLwErhCaxBa-hPmQ@mail.gmail.com>
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/