threads / discuss / 5818

How to checkout a tag?

Subject: How to checkout a tag?

## tl;dr

5 messages between Oct 5, 2006 and Oct 6, 2006.

replies: 4people: 3as markdown or json

Jeff Garzik· Oct 5, 2006, 10:47 UTC · lore

Sometimes I receive a kernel patch based off an older version of the kernel, for example a 2.6.18 patch when the current kernel is 2.6.19-rc1.

I would like to create a branch starting at 2.6.18, merge the patch, and then merge up to the current kernel.

How does one check out a tag, or create a branch based on a tag's starting point?

	Jeff
Andy Whitcroft· Oct 5, 2006, 11:06 UTC · re: Jeff Garzik · lore

Re: How to checkout a tag?

Jeff Garzik wrote:
Show 9 quoted lines
> 
> Sometimes I receive a kernel patch based off an older version of the
> kernel, for example a 2.6.18 patch when the current kernel is 2.6.19-rc1.
> 
> I would like to create a branch starting at 2.6.18, merge the patch, and
> then merge up to the current kernel.
> 
> How does one check out a tag, or create a branch based on a tag's
> starting point?
A tag is a ref like any other:
	git checkout -b branchname tag
-apw
Jeff Garzik· Oct 5, 2006, 11:13 UTC · re: Andy Whitcroft · lore

Re: How to checkout a tag?

Andy Whitcroft wrote:
Show 13 quoted lines
> Jeff Garzik wrote:
>> Sometimes I receive a kernel patch based off an older version of the
>> kernel, for example a 2.6.18 patch when the current kernel is 2.6.19-rc1.
>>
>> I would like to create a branch starting at 2.6.18, merge the patch, and
>> then merge up to the current kernel.
>>
>> How does one check out a tag, or create a branch based on a tag's
>> starting point?
> 
> A tag is a ref like any other:
> 
> 	git checkout -b branchname tag
Weird.  No idea why that didn't work before, for me.
Thanks for the clue-hammer.
	Jeff
Andy Whitcroft· Oct 5, 2006, 11:18 UTC · re: Jeff Garzik · lore

Re: How to checkout a tag?

Jeff Garzik wrote:
Show 19 quoted lines
> Andy Whitcroft wrote:
>> Jeff Garzik wrote:
>>> Sometimes I receive a kernel patch based off an older version of the
>>> kernel, for example a 2.6.18 patch when the current kernel is
>>> 2.6.19-rc1.
>>>
>>> I would like to create a branch starting at 2.6.18, merge the patch, and
>>> then merge up to the current kernel.
>>>
>>> How does one check out a tag, or create a branch based on a tag's
>>> starting point?
>>
>> A tag is a ref like any other:
>>
>>     git checkout -b branchname tag
> 
> Weird.  No idea why that didn't work before, for me.
> 
> Thanks for the clue-hammer.

I think I've been in a place where I git fetched a tag and I ended up with the objects, but not with an actual local tag for it. Perhaps that happened to you.

-apw
Jakub Narebski· Oct 6, 2006, 07:32 UTC · re: Andy Whitcroft · lore

Re: How to checkout a tag?

Andy Whitcroft wrote:
Show 14 quoted lines
> Jeff Garzik wrote:
>> 
>> Sometimes I receive a kernel patch based off an older version of the
>> kernel, for example a 2.6.18 patch when the current kernel is 2.6.19-rc1.
>> 
>> I would like to create a branch starting at 2.6.18, merge the patch, and
>> then merge up to the current kernel.
>> 
>> How does one check out a tag, or create a branch based on a tag's
>> starting point?
> 
> A tag is a ref like any other:
> 
>       git checkout -b branchname tag
Which is a shortcut for
        git branch branchname tag
        git checkout branchname

You cannot checkout a tag [object], because branch has to be able to move forward to the new commit when you commit changes,

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

← back to recent threads