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

Re: checkout without touching HEAD

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 27, 2007, 22:38 UTC
Message-ID
<7vsl1nix0x.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<46a038f90712271422o7a831c09s463735ec41356b59@mail.gmail.com>
"Martin Langhoff" <martin.langhoff@gmail.com> writes:
Show 9 quoted lines
> Is there a way to get a 'checkout' of a treeish _directly_ from git to
> an empty (or 'no conflicting paths'-guaranteed) directory, without
> touching HEAD?
>
> Using `git-archive ... | tar -x` is a waste of time and resources -- I
> do want this to be fast for large datasets. I have hacked it a bit by
> backing up HEAD, using git checkout with a temporary index, and then
> restoring HEAD, which I can do because my script has a big fat lock
> around it. But it's very un-gittish to need a big lock around me.
git read-tree -m -u HEAD $treeish
Previous: Martin LanghoffNext: Martin Langhoff
Message 2 of 3 in “checkout without touching HEAD”
  1. Martin LanghoffDec 27, 2007
  2. Junio C HamanoDec 27, 2007
  3. Martin LanghoffDec 27, 2007

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.