{"thread":{"id":"38678","subject":"Move commits not in origin to a branch","startedAt":"2015-03-02T13:25:58Z","lastAt":"2015-03-02T15:43:32Z","messageCount":3,"participants":["shawn wilson","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"256837","messageId":"CAH_OBicENXL967L4LubDzrqq2qxuZSqye3o6SPAq6oKM0=94Og@mail.gmail.com","threadId":"38678","inReplyTo":null,"subject":"Move commits not in origin to a branch","fromName":"shawn wilson","fromEmail":"ag4ve.us@gmail.com","sentAt":"2015-03-02T13:25:58Z","receivedAt":"2015-03-02T13:25:58Z","isPatch":false,"sender":{"key":"ag4ve.us@gmail.com","avatar":null},"body":"How do I move commits I haven't pushed into a new branch?\n\n % git log origin..master --pretty=format:'%h'\nf7d3a19\n1f186c9\n66d99f6\n\nWhich I'd like to be in a new branch.\n"},{"id":"256843","messageId":"54F479A1.300@drmicha.warpmail.net","threadId":"38678","inReplyTo":"CAH_OBicENXL967L4LubDzrqq2qxuZSqye3o6SPAq6oKM0=94Og@mail.gmail.com","subject":"Re: Move commits not in origin to a branch","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2015-03-02T14:54:25Z","receivedAt":"2015-03-02T14:54:25Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"shawn wilson venit, vidit, dixit 02.03.2015 14:25:\n> How do I move commits I haven't pushed into a new branch?\n> \n>  % git log origin..master --pretty=format:'%h'\n> f7d3a19\n> 1f186c9\n> 66d99f6\n> \n> Which I'd like to be in a new branch.\n> \n\nDo you want them to be on the new branch as they are, i.e. as commits\nbuilt on top of master? Then\n\ngit branch mybranch master\n\nwill create a new branch \"mybranch\" which contains those commits. If you\nwant to \"remove\" them from master, then\n\ngit checkout master # unless you are there already\ngit reset --keep origin/master\n\nto \"rewind\" master to commit \"origin/master\".\n\nMichael\n"},{"id":"256848","messageId":"CAH_OBicLoSvnKx=2Y1oHCbXK+mUsKpg-TNwMfiaYs816kfsrwA@mail.gmail.com","threadId":"38678","inReplyTo":"54F479A1.300@drmicha.warpmail.net","subject":"Re: Move commits not in origin to a branch","fromName":"shawn wilson","fromEmail":"ag4ve.us@gmail.com","sentAt":"2015-03-02T15:43:32Z","receivedAt":"2015-03-02T15:43:32Z","isPatch":false,"sender":{"key":"ag4ve.us@gmail.com","avatar":null},"body":"On Mon, Mar 2, 2015 at 9:54 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> shawn wilson venit, vidit, dixit 02.03.2015 14:25:\n>> How do I move commits I haven't pushed into a new branch?\n>>\n>>  % git log origin..master --pretty=format:'%h'\n>> f7d3a19\n>> 1f186c9\n>> 66d99f6\n>>\n>> Which I'd like to be in a new branch.\n>>\n>\n> Do you want them to be on the new branch as they are, i.e. as commits\n> built on top of master? Then\n>\n> git branch mybranch master\n>\n\nOh cool, I think that's what I wanted. I didn't realize it was that\neasy - I said screw it and went and pushed them, but... for next time\n(or I'll stop being stupid and work in a branch from now on).\n\nThanks\n"}]}