git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "norbert.nemec" <norbert.nemec@native-instruments.de>
Cc: git@vger.kernel.org
Subject: Re: Status after 'git clone --no-checkout' ?
Date: Thu, 1 Dec 2011 14:00:58 -0500	[thread overview]
Message-ID: <20111201190058.GC2873@sigill.intra.peff.net> (raw)
In-Reply-To: <jb59h0$p3e$1@dough.gmane.org>

On Wed, Nov 30, 2011 at 02:02:22PM +0100, norbert.nemec wrote:

> what exactly is the status after 'git clone --no-checkout'? Is there
> any straightforward way how one could end up in this state starting
> from a regularly checked out repository?

You have a HEAD which points to some actual commit, but no index or
working tree. I don't think there is a particular name for this state.

You can get something similar in an existing repo by deleting all of the
working tree files and removing .git/index.

> 'git checkout' without any further options serves to move from the
> aforementioned special state to a regular checked out state.
> Otherwise it never seems to do anything. Are there any other
> situations where 'git checkout' on its own would have any effect?

By itself, I don't think so. But you can use "git checkout -f" to
discard changes in the index and working tree, setting them back to the
state in HEAD.

At one point, some people used "git checkout" as a no-op, because it
would print the "ahead/behind" information with respect to the upstream.
These days, that information is part of "git status", so I suspect
people use that instead.

-Peff

  reply	other threads:[~2011-12-01 19:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 13:02 Status after 'git clone --no-checkout' ? norbert.nemec
2011-12-01 19:00 ` Jeff King [this message]
2011-12-02  7:53   ` norbert.nemec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111201190058.GC2873@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=norbert.nemec@native-instruments.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).