git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alexey Feldgendler" <alexeyf@opera.com>
To: git@vger.kernel.org
Subject: Re: Correcting forgetting to make a new branch
Date: Fri, 11 Mar 2011 16:46:50 +0100	[thread overview]
Message-ID: <op.vr6rgcqs56e9f9@xman.eng.oslo.osa> (raw)
In-Reply-To: <AANLkTi=fp=-pwi7Mj9TptP22mtP51bzq5UwTLRx9LnNB@mail.gmail.com>

On Fri, 11 Mar 2011 16:31:18 +0100, Howard Miller  
<howard@e-learndesign.co.uk> wrote:

> The scenario is that I have done work on a branch and made a number of
> commits. What I wanted to do was to start a new branch before I made
> these commits. Unfortunatel, I got distracted and forgot that I hadn't
> done it.
>
> Is there are neat way to create the branch and 'move' the commits over?

Just create a new branch right where you are, it will be correct.

However, the branch that was active before when you should have branched  
will have been unintentionally updated. To fix that, you'll need to move  
the old branch a few commits back:

git branch -f <old-branch> <where-it-was-before>


-- 
Alexey Feldgendler
Software Developer, Desktop Team, Opera Software ASA
[ICQ: 115226275] http://my.opera.com/feldgendler/

  reply	other threads:[~2011-03-11 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 15:31 Correcting forgetting to make a new branch Howard Miller
2011-03-11 15:46 ` Alexey Feldgendler [this message]
2011-03-11 15:50   ` Matthieu Moy
2011-03-11 15:53     ` Howard Miller
2011-03-11 15:49 ` Michael J Gruber

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=op.vr6rgcqs56e9f9@xman.eng.oslo.osa \
    --to=alexeyf@opera.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 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).