Re: Correcting forgetting to make a new branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 11 Mar 2011 16:31:18 +0100, Howard Miller <howard@xxxxxxxxxxxxxxxxxxx> 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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]