{"thread":{"id":"29054","subject":"Status after 'git clone --no-checkout' ?","startedAt":"2011-11-30T13:02:22Z","lastAt":"2011-12-02T07:53:03Z","messageCount":3,"participants":["norbert.nemec","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"180153","messageId":"jb59h0$p3e$1@dough.gmane.org","threadId":"29054","inReplyTo":null,"subject":"Status after 'git clone --no-checkout' ?","fromName":"norbert.nemec","fromEmail":"norbert.nemec@native-instruments.de","sentAt":"2011-11-30T13:02:22Z","receivedAt":"2011-11-30T13:02:22Z","isPatch":false,"sender":{"key":"norbert.nemec@native-instruments.de","avatar":null},"body":"Hi there,\n\nwhat exactly is the status after 'git clone --no-checkout'? Is there any \nstraightforward way how one could end up in this state starting from a \nregularly checked out repository?\n\nA somewhat related question:\n\n'git checkout' without any further options serves to move from the \naforementioned special state to a regular checked out state. Otherwise \nit never seems to do anything. Are there any other situations where 'git \ncheckout' on its own would have any effect?\n\nThanks for any insight on this!\n\nNorbert Nemec\n"},{"id":"180215","messageId":"20111201190058.GC2873@sigill.intra.peff.net","threadId":"29054","inReplyTo":"jb59h0$p3e$1@dough.gmane.org","subject":"Re: Status after 'git clone --no-checkout' ?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-12-01T19:00:58Z","receivedAt":"2011-12-01T19:00:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Nov 30, 2011 at 02:02:22PM +0100, norbert.nemec wrote:\n\n> what exactly is the status after 'git clone --no-checkout'? Is there\n> any straightforward way how one could end up in this state starting\n> from a regularly checked out repository?\n\nYou have a HEAD which points to some actual commit, but no index or\nworking tree. I don't think there is a particular name for this state.\n\nYou can get something similar in an existing repo by deleting all of the\nworking tree files and removing .git/index.\n\n> 'git checkout' without any further options serves to move from the\n> aforementioned special state to a regular checked out state.\n> Otherwise it never seems to do anything. Are there any other\n> situations where 'git checkout' on its own would have any effect?\n\nBy itself, I don't think so. But you can use \"git checkout -f\" to\ndiscard changes in the index and working tree, setting them back to the\nstate in HEAD.\n\nAt one point, some people used \"git checkout\" as a no-op, because it\nwould print the \"ahead/behind\" information with respect to the upstream.\nThese days, that information is part of \"git status\", so I suspect\npeople use that instead.\n\n-Peff\n"},{"id":"180240","messageId":"jba050$uhs$1@dough.gmane.org","threadId":"29054","inReplyTo":"20111201190058.GC2873@sigill.intra.peff.net","subject":"Re: Status after 'git clone --no-checkout' ?","fromName":"norbert.nemec","fromEmail":"norbert.nemec@native-instruments.de","sentAt":"2011-12-02T07:53:03Z","receivedAt":"2011-12-02T07:53:03Z","isPatch":false,"sender":{"key":"norbert.nemec@native-instruments.de","avatar":null},"body":"Thanks a lot for this concise explanation -- exactly what I was hoping for!\n\n\nAm 01.12.11 20:00, schrieb Jeff King:\n> On Wed, Nov 30, 2011 at 02:02:22PM +0100, norbert.nemec wrote:\n>\n>> what exactly is the status after 'git clone --no-checkout'? Is there\n>> any straightforward way how one could end up in this state starting\n>> from a regularly checked out repository?\n>\n> You have a HEAD which points to some actual commit, but no index or\n> working tree. I don't think there is a particular name for this state.\n>\n> You can get something similar in an existing repo by deleting all of the\n> working tree files and removing .git/index.\n>\n>> 'git checkout' without any further options serves to move from the\n>> aforementioned special state to a regular checked out state.\n>> Otherwise it never seems to do anything. Are there any other\n>> situations where 'git checkout' on its own would have any effect?\n>\n> By itself, I don't think so. But you can use \"git checkout -f\" to\n> discard changes in the index and working tree, setting them back to the\n> state in HEAD.\n>\n> At one point, some people used \"git checkout\" as a no-op, because it\n> would print the \"ahead/behind\" information with respect to the upstream.\n> These days, that information is part of \"git status\", so I suspect\n> people use that instead.\n>\n> -Peff\n"}]}