From: Michael Witten Date: Sat, 07 Aug 2010 03:10:28 GMT Subject: Re: Decompressing a tree to a location other than the working directory Message-ID: In-Reply-To: <20100806184345.GB2985@burratino> On Fri, Aug 6, 2010 at 13:43, Jonathan Nieder wrote: >> git checkout allows one to checkout a particular version of a certain >> path in the working directory.  Are there accessible plumbing commands >> that can be used to accomplish the same thing, but change the target >> directory. > > I don’t know if it is plumbing, but "git archive" is very useful for > that. > >  $ git archive HEAD^:Documentation | (cd elsewhere && tar xf -) For single files (rather than directories), you could do this: git show HEAD^:path/to/file > /some/path/file