* cherry-pick/rebase question
@ 2009-01-21 17:27 Jay Soffian
2009-01-21 17:46 ` Jay Soffian
0 siblings, 1 reply; 2+ messages in thread
From: Jay Soffian @ 2009-01-21 17:27 UTC (permalink / raw)
To: Git Mailing List
Say I have the following linear set of commits on master:
A---B---C---D---E---F---G master
And I realize that I've intermixed two topics such that I want to move
commits B and E-G to their own branch. So my result should be:
A---C'---D' master
\
B'---E'---F'---G' topic
What's the best way to do it?
I read the rebase and cherry-pick man pages, found myself confused,
tried rebase a few different ways, failed, and ended up doing what I
needed with format-patch and am. (Extract B-G with format-patch, reset
master to A, create topic branch, apply B,E,F,G to topic with am,
similarly apply C,D to master with am.)
Thanks,
j.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: cherry-pick/rebase question
2009-01-21 17:27 cherry-pick/rebase question Jay Soffian
@ 2009-01-21 17:46 ` Jay Soffian
0 siblings, 0 replies; 2+ messages in thread
From: Jay Soffian @ 2009-01-21 17:46 UTC (permalink / raw)
To: Git Mailing List
On Wed, Jan 21, 2009 at 12:27 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
> Say I have the following linear set of commits on master:
>
> A---B---C---D---E---F---G master
>
> And I realize that I've intermixed two topics such that I want to move
> commits B and E-G to their own branch. So my result should be:
>
> A---C'---D' master
> \
> B'---E'---F'---G' topic
>
> What's the best way to do it?
>
> I read the rebase and cherry-pick man pages, found myself confused,
> tried rebase a few different ways, failed, and ended up doing what I
> needed with format-patch and am. (Extract B-G with format-patch, reset
> master to A, create topic branch, apply B,E,F,G to topic with am,
> similarly apply C,D to master with am.)
Hmm, not sure why I didn't think of it earlier, but I guess the easiest way is:
(master)$ git co -b topic
(topic )$ git rebase -i A (remove C and D)
(topic )$ git co master
(master)$ git rebase -i A (remove B, E-G)
j.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-21 17:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 17:27 cherry-pick/rebase question Jay Soffian
2009-01-21 17:46 ` Jay Soffian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).