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).