I have gitosis running on my server. My build system needs to get a copy of the code from gitosis. Right now I clone the whole repository, which takes a long time.
How do I get just the head of a branch? (I've tried git archive, but can't seem to get an archive from gitosis.)
Can I create an archive from a bare repository?
Pass the --depth=1
flag to git clone
to only get the HEAD commit. This creates a "shallow clone". Note that there are limitations with a shallow clone: you can't get the full history (obviously), you cannot clone or pull from it, and you cannot push from it.
gitosis does not yet support git-archive, AFAIS. The corresponding branch at http://eagain.net/gitweb/?p=gitosis.git;a=commitdiff;h=refs/heads/remote-archive has not been merged.
So you can't use "git archive --remote=git://git.example.com/repo.git ..." with gitosis yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With