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

Re: Decompressing a tree to a location other than the working directory

From
Michael Witten <mfwitten@gmail.com>
Date
Aug 7, 2010, 03:10 UTC
Message-ID
<AANLkTi=iApfmo3HhDU9BgxvJuHJwuDc=nHFpOib9TM8x@mail.gmail.com>
In-Reply-To
<20100806184345.GB2985@burratino>
On Fri, Aug 6, 2010 at 13:43, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 9 quoted lines
>> 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
Previous: Jonathan NiederNext: Jakub Narebski
Message 3 of 4 in “Decompressing a tree to a location other than the working directory”
  1. Joshua ShraderAug 6, 2010
  2. Jonathan NiederAug 6, 2010
  3. Michael WittenAug 7, 2010
  4. Jakub NarebskiAug 6, 2010

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.