Re: How to create a new branch based on a tag?
- From
Martin Langhoff <martin.langhoff@gmail.com>
- Date
- Oct 21, 2005, 03:37 UTC
- Message-ID
- <46a038f90510202037l7dd40271qcc0634295e092068@mail.gmail.com>
- In-Reply-To
- <435901F7.9020509@ust.hk>
On 10/22/05, Ben Lau <benlau@ust.hk> wrote:
Show 10 quoted lines
> Hi, > > I would like to create a branch of my own work based on a specific > kernel version(i.e > v2.6.11). I tried with: > > > git-branch my2.6.11 v2.6.11 > error: Object 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c is a tree, not a > commit > fatal: Needed a single revision
What you're after is
git-rev-parse --verify <tagname>^0 > .refs/heads/mynewbranch
"branches" are very lightweight -- it's a ref containing the SHA1 of the commit you want it to be at. So if you find the SHA1 of the commit in gitk or wherever, just
echo SHA1 > .refs/heads/mynewbranch
and you're sorted. Do git-checkout to switch to it.
cheers,
martin