Re: Moving commits from one branch to another (improving my git fu!)
- From
Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
- Date
- Oct 22, 2013, 06:11 UTC
- Message-ID
- <CAC+QLdQADFPvuZ6VcDqSUYSd_sn54LK=YLqaW3U2DC1MbnsM+g@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.2.00.1310220647400.13299@ds9.cixit.se>
Show 7 quoted lines
>> $ 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.
Show 8 quoted lines
> > 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'.
Show 5 quoted lines
> > 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/