* Move commits not in origin to a branch
@ 2015-03-02 13:25 shawn wilson
2015-03-02 14:54 ` Michael J Gruber
0 siblings, 1 reply; 3+ messages in thread
From: shawn wilson @ 2015-03-02 13:25 UTC (permalink / raw)
To: Git List
How do I move commits I haven't pushed into a new branch?
% git log origin..master --pretty=format:'%h'
f7d3a19
1f186c9
66d99f6
Which I'd like to be in a new branch.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Move commits not in origin to a branch
2015-03-02 13:25 Move commits not in origin to a branch shawn wilson
@ 2015-03-02 14:54 ` Michael J Gruber
2015-03-02 15:43 ` shawn wilson
0 siblings, 1 reply; 3+ messages in thread
From: Michael J Gruber @ 2015-03-02 14:54 UTC (permalink / raw)
To: shawn wilson, Git List
shawn wilson venit, vidit, dixit 02.03.2015 14:25:
> How do I move commits I haven't pushed into a new branch?
>
> % git log origin..master --pretty=format:'%h'
> f7d3a19
> 1f186c9
> 66d99f6
>
> Which I'd like to be in a new branch.
>
Do you want them to be on the new branch as they are, i.e. as commits
built on top of master? Then
git branch mybranch master
will create a new branch "mybranch" which contains those commits. If you
want to "remove" them from master, then
git checkout master # unless you are there already
git reset --keep origin/master
to "rewind" master to commit "origin/master".
Michael
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Move commits not in origin to a branch
2015-03-02 14:54 ` Michael J Gruber
@ 2015-03-02 15:43 ` shawn wilson
0 siblings, 0 replies; 3+ messages in thread
From: shawn wilson @ 2015-03-02 15:43 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Git List
On Mon, Mar 2, 2015 at 9:54 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> shawn wilson venit, vidit, dixit 02.03.2015 14:25:
>> How do I move commits I haven't pushed into a new branch?
>>
>> % git log origin..master --pretty=format:'%h'
>> f7d3a19
>> 1f186c9
>> 66d99f6
>>
>> Which I'd like to be in a new branch.
>>
>
> Do you want them to be on the new branch as they are, i.e. as commits
> built on top of master? Then
>
> git branch mybranch master
>
Oh cool, I think that's what I wanted. I didn't realize it was that
easy - I said screw it and went and pushed them, but... for next time
(or I'll stop being stupid and work in a branch from now on).
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-02 15:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-02 13:25 Move commits not in origin to a branch shawn wilson
2015-03-02 14:54 ` Michael J Gruber
2015-03-02 15:43 ` shawn wilson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.