Thread (6 messages) flat view 6 messages, 5 authors, 2016-06-15

Re: Exporting a tree from a repository

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:21

Ciprian Dorin Craciun, Sun, Jul 15, 2007 09:12:08 +0200:
   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).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help