git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Lau <benlau@ust.hk>
To: Martin Langhoff <martin.langhoff@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to create a new branch based on a tag?
Date: Sat, 22 Oct 2005 00:15:29 +0800	[thread overview]
Message-ID: <43591421.9030400@ust.hk> (raw)
In-Reply-To: <46a038f90510202037l7dd40271qcc0634295e092068@mail.gmail.com>

Martin Langhoff wrote:

>On 10/22/05, Ben Lau <benlau@ust.hk> wrote:
>  
>
>>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
>  
>
The command complains:

   >git-rev-parse --verify v2.6.11^
   error: Object 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c is a tree, not 
a commit
   fatal: Needed a single revision

I think it need another way to convert a tag/tree object into a commit ?

  reply	other threads:[~2005-10-21  4:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-21 14:57 How to create a new branch based on a tag? Ben Lau
2005-10-21  3:37 ` Martin Langhoff
2005-10-21 16:15   ` Ben Lau [this message]
2005-10-21  3:50 ` Junio C Hamano
2005-10-21 16:23   ` Ben Lau
2005-10-21  5:08     ` Junio C Hamano
2005-10-21 19:14       ` Ben Lau
2005-10-21  8:20         ` Junio C Hamano

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=43591421.9030400@ust.hk \
    --to=benlau@ust.hk \
    --cc=git@vger.kernel.org \
    --cc=martin.langhoff@gmail.com \
    /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).