From: Michael J Gruber <git@drmicha.warpmail.net>
To: shawn wilson <ag4ve.us@gmail.com>, Git List <git@vger.kernel.org>
Subject: Re: Move commits not in origin to a branch
Date: Mon, 02 Mar 2015 15:54:25 +0100 [thread overview]
Message-ID: <54F479A1.300@drmicha.warpmail.net> (raw)
In-Reply-To: <CAH_OBicENXL967L4LubDzrqq2qxuZSqye3o6SPAq6oKM0=94Og@mail.gmail.com>
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
next prev parent reply other threads:[~2015-03-02 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 13:25 Move commits not in origin to a branch shawn wilson
2015-03-02 14:54 ` Michael J Gruber [this message]
2015-03-02 15:43 ` shawn wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F479A1.300@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=ag4ve.us@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.