Skip to contentSkip to conversation

How to checkout a tag?

DISCUSSION Jeff Garzik 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 9 lines · Jeff Garzik

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

#2 lore raw
Quoted 7 lines · Andy Whitcroft
Quoted 6 lines · Jeff Garzik

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.

Quoted 6 lines
Quoted 2 lines

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

#3 lore raw
Quoted 12 lines · Jeff Garzik
Quoted 11 lines · Andy Whitcroft
Quoted 9 lines · Jeff Garzik

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?

Quoted 7 lines
Quoted 3 lines

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

#4 lore raw
In reply to Andy Whitcroft
Quoted 8 lines · Andy Whitcroft
Quoted 7 lines · Jeff Garzik

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.

Quoted 6 lines
Quoted 2 lines

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,

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git