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

How to archive repo from sub-directory

From
Bill Lear <rael@zopyra.com>
Date
Mar 11, 2008, 00:33 UTC
Message-ID
<18389.54080.211086.922039@lisa.zopyra.com>

If I have a git repo with several levels of sub-directories, how do I get git-archive to archive the entire tree, and not just the tree from where I am? Example:

% cd foo % cat .git/description foo project % cd bar/baz % git archive --format=tar --prefix=foo/ HEAD | bzip2 > foo.tar.bz2

produces a tar file starting only at baz.

If I can't conjur this on the command line with a clever argument to git archive (I've tried several), then how would I ask git "What is your top-level directory" so at least I could write a script to do this?

Bill
Next: Nguyen Thai Ngoc Duy
Message 1 of 2 in “How to archive repo from sub-directory”
  1. Bill LearMar 11, 2008
  2. Nguyen Thai Ngoc DuyMar 11, 2008

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.