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

Re: Question: git clone --no-checkout behavior

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 12, 2012, 22:02 UTC
Message-ID
<7vbojkabad.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAGyf7-Fkn9bjJ9EZEFNsba8U-RUzrB3TzmB-YbcvwUFRbHXG+Q@mail.gmail.com>
Bryan Turner <bturner@atlassian.com> writes:
Show 15 quoted lines
>> If you populated $GIT_DIR/index from the tree of HEAD, you would see
>> everything is deleted in the working tree.  You can simulate it by
>> doing this:
>>
>>         git clone -n $over_there here
>>         cd here
>>         git read-tree HEAD
>>         git status
>>
>> But it would not help people who want to check another branch out
>> immediately after cloning with -n, which is the whole point of the
>> option, so...
>
> Is the reset call in my example in essence performing that same read-tree,
> when it unstages the changes?

"git reset" (without any other parameters) reads the HEAD tree into the index without touching the working tree, so I think it is probably equivalent.

Previous: Junio C Hamano
Message 3 of 3 in “Question: git clone --no-checkout behavior”
  1. Bryan TurnerJul 12, 2012
  2. Junio C HamanoJul 12, 2012
  3. Junio C HamanoJul 12, 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.