git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Checkout tag?

From
MBMagnus Bäck <magnus.back@sonyericsson.com>
Date
Jan 22, 2012, 11:31 UTC
Message-ID
<20120122113115.GA31545@jpl.local>
In-Reply-To
<1327227956026-7213061.post@n2.nabble.com>
On Sunday, January 22, 2012 at 11:25 CET,
     Abscissa <bus_nabble_git@semitwist.com> wrote:
Show 5 quoted lines
> I saw that, but it seems to imply that it's not a simple:
> 
> >git checkout tag_name
> 
> because of the required <pathspec>, whatever that is.

It isn't required. The part of the manual that I quoted (from Git 1.7.2.5) indicated that the pathspec is mandatory, but looking at the command synopsis at the top of the man page it's actually listed as optional.

Looking at an up to date Git 1.7.9-rc2 man page, it still seems slightly inconsistent with itself. The synopsis at the top says

      git checkout [-p|--patch] [<tree-ish>] [--] [<paths>...]
while the text in the DESCRIPTION section says
      git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...

The DETACHED HEAD section of the man page contains an example of checking out a tag, by the way.

If you're doubtful, why don't you just create a tag and try things out for yourself?

-- 
Magnus Bäck                   Opinions are my own and do not necessarily
SW Configuration Manager      represent the ones of my employer, etc.
Sony Ericsson
Previous: AbscissaNext: Jonathan Nieder
Message 4 of 17 in “Checkout tag?”
  1. AbscissaJan 22, 2012
  2. Magnus BäckJan 22, 2012
  3. AbscissaJan 22, 2012
  4. Magnus BäckJan 22, 2012
  5. Jonathan NiederJan 22, 2012
  6. Magnus BäckJan 22, 2012
  7. AbscissaJan 22, 2012
  8. AbscissaJan 22, 2012
  9. AbscissaJan 22, 2012
  10. AbscissaJan 22, 2012
  11. AbscissaJan 22, 2012
  12. AbscissaJan 22, 2012
  13. AbscissaJan 22, 2012
  14. Jakub NarebskiJan 22, 2012
  15. Nguyen Thai Ngoc DuyJan 22, 2012
  16. AbscissaJan 22, 2012
  17. AbscissaJan 22, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.