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

Re: [Feature Request] git export

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 10, 2009, 16:54 UTC
Message-ID
<7vk51b38zj.fsf@alter.siamese.dyndns.org>
In-Reply-To
<200908101822.59940.thomas@koch.ro>
Thomas Koch <thomas@koch.ro> writes:
> could you please provide a simple solution to save a tree object into an 
> arbitrary location?
> I found some hints, that it would be possible by missusing either git 
> checkout-index or git-archive, but I think that it shouldn't require that much 

If you are talking about a tree object, then git-archive is what you want. It was invented almost for this exact purpose, but unlike "export" that would only copy to a directory, you can get a tarball out of it when you do not want to expand the result into a directory; it is more versatile form. The manual page for the command has an example (look for "/var/tmp") so I won't repeat the cut-and-paste recipe here.

If you are not talking about a tree object but is talking about the contents recorded in your index, checkout-index with the --prefix option may be what you want. The manual page for the command has an example (look for "--prefix=git-export-dir/") so I won't repeat it here.

Previous: Tim VisherNext: Johannes Schindelin
Message 5 of 7 in “[Feature Request] git export”
  1. Thomas KochAug 10, 2009
  2. Tim VisherAug 10, 2009
  3. Thomas KochAug 10, 2009
  4. Tim VisherAug 10, 2009
  5. Junio C HamanoAug 10, 2009
  6. Johannes SchindelinAug 10, 2009
  7. Michael J GruberAug 11, 2009

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.