From: Junio C Hamano Date: Thu, 27 Dec 2007 22:38:06 GMT Subject: Re: checkout without touching HEAD Message-ID: <7vsl1nix0x.fsf@gitster.siamese.dyndns.org> In-Reply-To: <46a038f90712271422o7a831c09s463735ec41356b59@mail.gmail.com> "Martin Langhoff" writes: > 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