{"thread":{"id":"29424","subject":"Checkout tag?","startedAt":"2012-01-22T10:05:54Z","lastAt":"2012-01-22T17:33:52Z","messageCount":17,"participants":["Abscissa","Magnus Bäck","Nguyen Thai Ngoc Duy","Jakub Narebski","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"182922","messageId":"1327226753653-7213023.post@n2.nabble.com","threadId":"29424","inReplyTo":null,"subject":"Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:05:54Z","receivedAt":"2012-01-22T10:05:54Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I've managed to figure out you switch branches with the checkout command,\nlike this:\n\n>git checkout branch_name\n\nDoes that work for tags as well? The docs don't seem clear on that. If not,\nhow do you get the working copy to be a specific tag?\n\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213023.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182923","messageId":"20120122101116.GA31022@jpl.local","threadId":"29424","inReplyTo":"1327226753653-7213023.post@n2.nabble.com","subject":"Re: Checkout tag?","fromName":"Magnus Bäck","fromEmail":"magnus.back@sonyericsson.com","sentAt":"2012-01-22T10:11:16Z","receivedAt":"2012-01-22T10:11:16Z","isPatch":false,"sender":{"key":"magnus.back@sonyericsson.com","avatar":null},"body":"On Sunday, January 22, 2012 at 11:05 CET,\n     Abscissa <bus_nabble_git@semitwist.com> wrote:\n\n> I've managed to figure out you switch branches with the checkout\n> command, like this:\n> \n> >git checkout branch_name\n> \n> Does that work for tags as well? The docs don't seem clear on that.\n> If not, how do you get the working copy to be a specific tag?\n\nYes, \"git checkout\" works for branches, tags, commit SHA-1s, and\nanything else that can be resolved to a SHA-1 identifying what to\ncheck out. The git-checkout(1) man page says the following:\n\n       git checkout [--patch] [<tree-ish>] [--] <pathspec>...\n           ... The <tree-ish> argument can be used to specify a\n           specific tree-ish (i.e. commit, tag or tree) ...\n\n-- \nMagnus Bäck                   Opinions are my own and do not necessarily\nSW Configuration Manager      represent the ones of my employer, etc.\nSony Ericsson\n"},{"id":"182924","messageId":"CACsJy8AUaJ_tkLSHYPZEPLuiNitRMS77b7n9JFeV6HABHj9Qiw@mail.gmail.com","threadId":"29424","inReplyTo":"1327226753653-7213023.post@n2.nabble.com","subject":"Re: Checkout tag?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-01-22T10:18:14Z","receivedAt":"2012-01-22T10:18:14Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Jan 22, 2012 at 5:05 PM, Abscissa <bus_nabble_git@semitwist.com> wrote:\n> I've managed to figure out you switch branches with the checkout command,\n> like this:\n>\n>>git checkout branch_name\n>\n> Does that work for tags as well? The docs don't seem clear on that. If not,\n> how do you get the working copy to be a specific tag?\n\nMagnus already answered your checkout question. I just want to add\nthat you can view a tag's content even without checking out. For\nexample,\"git archive\" can create a zip/tarball of any tree-ish. \"git\nls-tree\" lets you view directory structure of a tree-ish, \"git show\n<tree-ish>:path\" lets you view content of a specific file.\n-- \nDuy\n"},{"id":"182925","messageId":"1327227956026-7213061.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:25:56Z","receivedAt":"2012-01-22T10:25:56Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213061.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182927","messageId":"1327227996975-7213063.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:26:36Z","receivedAt":"2012-01-22T10:26:36Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213063.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182928","messageId":"1327228014236-7213066.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:26:54Z","receivedAt":"2012-01-22T10:26:54Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213066.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182929","messageId":"1327228044250-7213069.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:27:24Z","receivedAt":"2012-01-22T10:27:24Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213069.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182930","messageId":"1327228055847-7213072.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:27:35Z","receivedAt":"2012-01-22T10:27:35Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213072.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182931","messageId":"1327228108680-7213074.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:28:28Z","receivedAt":"2012-01-22T10:28:28Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213074.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182932","messageId":"1327228128119-7213076.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:28:48Z","receivedAt":"2012-01-22T10:28:48Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213076.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182933","messageId":"1327228152139-7213078.post@n2.nabble.com","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:29:12Z","receivedAt":"2012-01-22T10:29:12Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213078.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182934","messageId":"1327228177859-7213081.post@n2.nabble.com","threadId":"29424","inReplyTo":"CACsJy8AUaJ_tkLSHYPZEPLuiNitRMS77b7n9JFeV6HABHj9Qiw@mail.gmail.com","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:29:37Z","receivedAt":"2012-01-22T10:29:37Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"I saw that, but it seems to imply that it's not a simple:\n\n>git checkout tag_name\n\nbecause of the required <pathspec>, whatever that is.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213081.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182935","messageId":"1327228479519-7213090.post@n2.nabble.com","threadId":"29424","inReplyTo":"1327228177859-7213081.post@n2.nabble.com","subject":"Re: Checkout tag?","fromName":"Abscissa","fromEmail":"bus_nabble_git@semitwist.com","sentAt":"2012-01-22T10:34:39Z","receivedAt":"2012-01-22T10:34:39Z","isPatch":false,"sender":{"key":"bus_nabble_git@semitwist.com","avatar":null},"body":"Sorry for the duplicates. Nabble kept crashing every time I tried to post,\nbut I guess it was crashing after it posted to the mailing list.\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Checkout-tag-tp7213023p7213090.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182936","messageId":"m3ipk4dlfy.fsf@localhost.localdomain","threadId":"29424","inReplyTo":"20120122101116.GA31022@jpl.local","subject":"Re: Checkout tag?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2012-01-22T11:30:34Z","receivedAt":"2012-01-22T11:30:34Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Magnus Bäck <magnus.back@sonyericsson.com> writes:\n> On Sunday, January 22, 2012 at 11:05 CET,\n>      Abscissa <bus_nabble_git@semitwist.com> wrote:\n> \n> > I've managed to figure out you switch branches with the checkout\n> > command, like this:\n> > \n> >   $ git checkout branch_name\n> > \n> > Does that work for tags as well? The docs don't seem clear on that.\n> > If not, how do you get the working copy to be a specific tag?\n> \n> Yes, \"git checkout\" works for branches, tags, commit SHA-1s, and\n> anything else that can be resolved to a SHA-1 identifying what to\n> check out. [...]\n\nNote however that because you can generate new commits only on top of\nlocal branches (refs/heads/*), if you check out something other than\nlocal branch, e.g.:\n\n  $ git checkout v1.7.8\n  $ git checkout origin/next\n  $ git checkout HEAD^\n\nyou would be after such checkout in unnamed anonymous branch which\ncontents corresponds to what you checked out.  This state is called\n'detached HEAD', and shows e.g. in \"git branch output as\n\n  $ git branch\n  * (no branch)\n  master\n  ...\n\nOn the other hand if you don't want to checkout tag to explore it, but\nset contents of working area to the state it was in given tag, you can\nuse\n\n  $ git checkout v1.7.8 -- .\n\nHTH\n\n\nP.S. Instead of Nabble you can use GMane interface, or just use email\n(you don't have ot be subscribed to git@vger.kernel.org to post, and\nit is custom here to send replies also to author(s)).\n\n-- \nJakub Narebski\n"},{"id":"182937","messageId":"20120122113115.GA31545@jpl.local","threadId":"29424","inReplyTo":"1327227956026-7213061.post@n2.nabble.com","subject":"Re: Checkout tag?","fromName":"Magnus Bäck","fromEmail":"magnus.back@sonyericsson.com","sentAt":"2012-01-22T11:31:15Z","receivedAt":"2012-01-22T11:31:15Z","isPatch":false,"sender":{"key":"magnus.back@sonyericsson.com","avatar":null},"body":"On Sunday, January 22, 2012 at 11:25 CET,\n     Abscissa <bus_nabble_git@semitwist.com> wrote:\n\n> I saw that, but it seems to imply that it's not a simple:\n> \n> >git checkout tag_name\n> \n> because of the required <pathspec>, whatever that is.\n\nIt isn't required. The part of the manual that I quoted (from Git\n1.7.2.5) indicated that the pathspec is mandatory, but looking at\nthe command synopsis at the top of the man page it's actually listed\nas optional.\n\nLooking at an up to date Git 1.7.9-rc2 man page, it still seems\nslightly inconsistent with itself. The synopsis at the top says\n\n      git checkout [-p|--patch] [<tree-ish>] [--] [<paths>...]\n\nwhile the text in the DESCRIPTION section says\n\n      git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...\n\nThe DETACHED HEAD section of the man page contains an example of\nchecking out a tag, by the way.\n\nIf you're doubtful, why don't you just create a tag and try things\nout for yourself?\n\n-- \nMagnus Bäck                   Opinions are my own and do not necessarily\nSW Configuration Manager      represent the ones of my employer, etc.\nSony Ericsson\n"},{"id":"182940","messageId":"20120122170800.GA29215@burratino","threadId":"29424","inReplyTo":"20120122113115.GA31545@jpl.local","subject":"Re: Checkout tag?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-01-22T17:08:00Z","receivedAt":"2012-01-22T17:08:00Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nMagnus Bäck wrote:\n\n> Looking at an up to date Git 1.7.9-rc2 man page, it still seems\n> slightly inconsistent with itself. The synopsis at the top says\n>\n>       git checkout [-p|--patch] [<tree-ish>] [--] [<paths>...]\n>\n> while the text in the DESCRIPTION section says\n>\n>       git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...\n\nHmm, my copy says:\n\n\tSYNOPSIS\n\n\tgit checkout [-q] [-f] [-m] [<branch>]\n\tgit checkout [-q] [-f] [-m] [--detach] [<commit>]\n\tgit checkout [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]\n\tgit checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...\n\tgit checkout [-p|--patch] [<tree-ish>] [--] [<paths>...]\n\n\tDESCRIPTION\n\n\t... overview ...\n\n\tgit checkout [<branch>], git checkout -b|-B <new_branch> [<start point>],\n\tgit checkout [--detach] [<commit>]\n\n\t\tThis form switches branches by updating the index, working\n\t\ttree, and HEAD...\n\n\tgit checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...\n\n\t\tWhen <paths> or --patch are given, git checkout does not\n\t\tswitch branches. It updates the named paths...\n\nSo in the synopsis it lists five forms, and in the description section\nit lists two forms, the first of which has three variants.\n\nIt's not immediately obvious to me which inconsistency you are\npointing to as a source of confusion.  Could you elaborate, preferably\nwith suggested wording for a fix?  If you can do so in the form of a\npatch, all the better. ;-)\n\nThanks,\nJonathan\n"},{"id":"182942","messageId":"20120122173352.GA1068@jpl.local","threadId":"29424","inReplyTo":"20120122170800.GA29215@burratino","subject":"Re: Checkout tag?","fromName":"Magnus Bäck","fromEmail":"magnus.back@sonyericsson.com","sentAt":"2012-01-22T17:33:52Z","receivedAt":"2012-01-22T17:33:52Z","isPatch":false,"sender":{"key":"magnus.back@sonyericsson.com","avatar":null},"body":"On Sunday, January 22, 2012 at 18:08 CET,\n     Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n> Magnus Bäck wrote:\n> \n> > Looking at an up to date Git 1.7.9-rc2 man page, it still seems\n> > slightly inconsistent with itself. The synopsis at the top says\n> >\n> >       git checkout [-p|--patch] [<tree-ish>] [--] [<paths>...]\n> >\n> > while the text in the DESCRIPTION section says\n> >\n> >       git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...\n> \n> Hmm, my copy says:\n> \n> \tSYNOPSIS\n> \n> \tgit checkout [-q] [-f] [-m] [<branch>]\n> \tgit checkout [-q] [-f] [-m] [--detach] [<commit>]\n> \tgit checkout [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]\n> \tgit checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...\n> \tgit checkout [-p|--patch] [<tree-ish>] [--] [<paths>...]\n\nPerhaps I wasn't clear -- I didn't mean that the synopsis *only* listed\nthe form in my original quote above.\n\n> \tDESCRIPTION\n> \n> \t... overview ...\n> \n> \tgit checkout [<branch>], git checkout -b|-B <new_branch> [<start point>],\n> \tgit checkout [--detach] [<commit>]\n> \n> \t\tThis form switches branches by updating the index, working\n> \t\ttree, and HEAD...\n> \n> \tgit checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...\n> \n> \t\tWhen <paths> or --patch are given, git checkout does not\n> \t\tswitch branches. It updates the named paths...\n> \n> So in the synopsis it lists five forms, and in the description section\n> it lists two forms, the first of which has three variants.\n> \n> It's not immediately obvious to me which inconsistency you are\n> pointing to as a source of confusion.  Could you elaborate,\n> preferably with suggested wording for a fix?\n\nI simply meant that\n\n   git checkout [-p|--patch] [<tree-ish>] [--] [<paths>...]\n   git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...\n\naren't identical even though I assume they describe the exact same\nscenario. The first command synopsis makes it clear that paths are\noptional while the second indicates that at least one path must be\nspecified (unless \"...\" means \"zero, one, or more occurences\").\nAlso, \"paths\" != \"pathspec\".\n\n> If you can do so in the form of a patch, all the better. ;-)\n\nSure, but it won't be during the coming week. Not that the patch is\nterribly difficult to prepare but because I need legal approval to\nsubmit it, and it's not clear I'll have time to deal with all that\nduring my last week at work.\n\n-- \nMagnus Bäck                   Opinions are my own and do not necessarily\nSW Configuration Manager      represent the ones of my employer, etc.\nSony Ericsson\n"}]}