# How to checkout a tag?

5 messages from 2006-10-05 to 2006-10-06. Participants: Jeff Garzik, Andy Whitcroft, Jakub Narebski.
Thread: https://gitlist.dev/t/5818

## Jeff Garzik, 2006-10-05 10:47

Subject: How to checkout a tag?
Message-ID: <4524E2D5.3030907@garzik.org>
URL: https://gitlist.dev/e/4524E2D5.3030907%40garzik.org

```

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, 2006-10-05 11:06

Subject: Re: How to checkout a tag?
Message-ID: <4524E72D.9030101@shadowen.org>
URL: https://gitlist.dev/e/4524E72D.9030101%40shadowen.org
In-Reply-To: <4524E2D5.3030907@garzik.org>

```
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

-apw

```

## Jeff Garzik, 2006-10-05 11:13

Subject: Re: How to checkout a tag?
Message-ID: <4524E8C2.3060404@garzik.org>
URL: https://gitlist.dev/e/4524E8C2.3060404%40garzik.org
In-Reply-To: <4524E72D.9030101@shadowen.org>

```
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.

	Jeff

```

## Andy Whitcroft, 2006-10-05 11:18

Subject: Re: How to checkout a tag?
Message-ID: <4524EA18.3080704@shadowen.org>
URL: https://gitlist.dev/e/4524EA18.3080704%40shadowen.org
In-Reply-To: <4524E8C2.3060404@garzik.org>

```
Jeff Garzik wrote:
> 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, 2006-10-06 07:32

Subject: Re: How to checkout a tag?
Message-ID: <eg50om$7rs$1@sea.gmane.org>
URL: https://gitlist.dev/e/eg50om%247rs%241%40sea.gmane.org
In-Reply-To: <4524E72D.9030101@shadowen.org>

```
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

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

```
