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

Re: Exporting a tree from a repository

From
Alex Riesen <raa.lkml@gmail.com>
Date
Jul 15, 2007, 09:15 UTC
Message-ID
<20070715091510.GC2568@steel.home>
In-Reply-To
<8e04b5820707150012r13c5db69g96b97d910dc1b137@mail.gmail.com>
Ciprian Dorin Craciun, Sun, Jul 15, 2007 09:12:08 +0200:
Show 5 quoted lines
>    Now for the export thing... I know that I can just clone the
> remote repository and then remove the .git folder, but for my purpose
> I just want to have the HEAD tree downloaded, without any history...
> And by using git clone I end up downloading much more than I actually
> need.

Well, if you have a ssh access to remote repository, you can run git-archive there:

    $ ssh -n 'cd /dir/repo/.git && git --bare archive --prefix=<local-path> <tree>' |tar xf -
or even simplier:
    $ git archive --remote=<remote-host:remote-path> --prefix=<local-path>/ <tree> |tar xf -
(for whatever reason it does not work with just git-daemon).
Previous: Ciprian Dorin CraciunNext: martin f krafft
Message 5 of 6 in “Exporting a tree from a repository”
  1. Ciprian Dorin CraciunJul 14, 2007
  2. Julian PhillipsJul 14, 2007
  3. Junio C HamanoJul 15, 2007
  4. Ciprian Dorin CraciunJul 15, 2007
  5. Alex RiesenJul 15, 2007
  6. martin f krafftJul 15, 2007

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.