{"thread":{"id":"17286","subject":"cherry-pick/rebase question","startedAt":"2009-01-21T17:27:34Z","lastAt":"2009-01-21T17:46:26Z","messageCount":2,"participants":["Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"101409","messageId":"76718490901210927m7fd3fbdey6ebd4cbfe44b1b71@mail.gmail.com","threadId":"17286","inReplyTo":null,"subject":"cherry-pick/rebase question","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-01-21T17:27:34Z","receivedAt":"2009-01-21T17:27:34Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"Say I have the following linear set of commits on master:\n\nA---B---C---D---E---F---G master\n\nAnd I realize that I've intermixed two topics such that I want to move\ncommits B and E-G to their own branch. So my result should be:\n\nA---C'---D' master\n \\\n  B'---E'---F'---G' topic\n\nWhat's the best way to do it?\n\nI read the rebase and cherry-pick man pages, found myself confused,\ntried rebase a few different ways, failed, and ended up doing what I\nneeded with format-patch and am. (Extract B-G with format-patch, reset\nmaster to A, create topic branch, apply B,E,F,G to topic with am,\nsimilarly apply C,D to master with am.)\n\nThanks,\n\nj.\n"},{"id":"101410","messageId":"76718490901210946v6494dd6ejca5a69e1d0d5cfa4@mail.gmail.com","threadId":"17286","inReplyTo":"76718490901210927m7fd3fbdey6ebd4cbfe44b1b71@mail.gmail.com","subject":"Re: cherry-pick/rebase question","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-01-21T17:46:26Z","receivedAt":"2009-01-21T17:46:26Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Jan 21, 2009 at 12:27 PM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> Say I have the following linear set of commits on master:\n>\n> A---B---C---D---E---F---G master\n>\n> And I realize that I've intermixed two topics such that I want to move\n> commits B and E-G to their own branch. So my result should be:\n>\n> A---C'---D' master\n>  \\\n>  B'---E'---F'---G' topic\n>\n> What's the best way to do it?\n>\n> I read the rebase and cherry-pick man pages, found myself confused,\n> tried rebase a few different ways, failed, and ended up doing what I\n> needed with format-patch and am. (Extract B-G with format-patch, reset\n> master to A, create topic branch, apply B,E,F,G to topic with am,\n> similarly apply C,D to master with am.)\n\nHmm, not sure why I didn't think of it earlier, but I guess the easiest way is:\n\n(master)$ git co -b topic\n(topic )$ git rebase -i A (remove C and D)\n(topic )$ git co master\n(master)$ git rebase -i A (remove B, E-G)\n\nj.\n"}]}