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=1flag togit cloneto 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.