git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to checkout a tag?
@ 2006-10-05 10:47 Jeff Garzik
  2006-10-05 11:06 ` Andy Whitcroft
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2006-10-05 10:47 UTC (permalink / raw)
  To: Git Mailing List


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to checkout a tag?
  2006-10-05 10:47 Jeff Garzik
@ 2006-10-05 11:06 ` Andy Whitcroft
  2006-10-05 11:13   ` Jeff Garzik
  2006-10-06  7:32   ` Jakub Narebski
  0 siblings, 2 replies; 6+ messages in thread
From: Andy Whitcroft @ 2006-10-05 11:06 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to checkout a tag?
  2006-10-05 11:06 ` Andy Whitcroft
@ 2006-10-05 11:13   ` Jeff Garzik
  2006-10-05 11:18     ` Andy Whitcroft
  2006-10-06  7:32   ` Jakub Narebski
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2006-10-05 11:13 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to checkout a tag?
  2006-10-05 11:13   ` Jeff Garzik
@ 2006-10-05 11:18     ` Andy Whitcroft
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Whitcroft @ 2006-10-05 11:18 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to checkout a tag?
@ 2006-10-05 12:00 linux
  0 siblings, 0 replies; 6+ messages in thread
From: linux @ 2006-10-05 12:00 UTC (permalink / raw)
  To: git; +Cc: linux

> A tag is a ref like any other:
> 
> 	git checkout -b branchname tag

For some operations, "git pull" in particular, I need
to include a "tags/" prefix.  E.g.

$ git fetch
remote: Generating pack...
remote: Done counting 27780 objects.
remote: Result has 22237 objects.
remote: Deltifying 22237 objects.
remote:  100% (22237/22237) done
Unpacking 22237 objects
remote: Total 22237, written 22237 (delta 18295), reused 17624 (delta 14183)
 100% (22237/22237) done
* refs/heads/origin: fast forward to branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
  from a77c64c1a641950626181b4857abb701d8f38ccc to d223a60106891bfe46febfacf46b20cd8509aaad
Auto-following refs/tags/v2.6.19-rc1
remote: Generating pack...
remote: Done counting 1 objects.
remote: Deltifying 1 objects.
remote:  100% (1/1) done
remote: Total 1, written 1 (delta 0), reused 1 (delta 0)
Unpacking 1 objects
 100% (1/1) done
* refs/tags/v2.6.19-rc1: storing tag 'v2.6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

$ git pull . v2.6.19-rc1
error: no such remote ref refs/heads/v2.6.19-rc1
Fetch failure: .

$ git pull -n . tags/v2.6.19-rc1
Updating from e478bec0ba0a83a48a0f6982934b6de079e7e6b3 to d223a60106891bfe46febfacf46b20cd8509aaad
Checking files out...
Checking files out...
 100% (6590/6590) done
Fast forward

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to checkout a tag?
  2006-10-05 11:06 ` Andy Whitcroft
  2006-10-05 11:13   ` Jeff Garzik
@ 2006-10-06  7:32   ` Jakub Narebski
  1 sibling, 0 replies; 6+ messages in thread
From: Jakub Narebski @ 2006-10-06  7:32 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-06  7:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 12:00 How to checkout a tag? linux
  -- strict thread matches above, loose matches on Subject: below --
2006-10-05 10:47 Jeff Garzik
2006-10-05 11:06 ` Andy Whitcroft
2006-10-05 11:13   ` Jeff Garzik
2006-10-05 11:18     ` Andy Whitcroft
2006-10-06  7:32   ` Jakub Narebski

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