Hacker News new | ask | show | jobs
by itroot 2288 days ago
Also --reference (or --shared) is a good parameter to speed-up cloning (for build, for example), if you have your repository cached in some other place. I was using it a long time ago when I was working on system that required to clone 20-40 repos to build. This approach decreased clone timings by an order of magnitude.
2 comments

Do you actually need clones in that scenario? I worked on a build system that grabbed source from several hundred repos at the starting point, and it turned out to be way faster to just grab it all as tarballs with aria2c.
Grapping the tarbell from where? To my best knowledge, tarbell export is not a part of git, but something git hosts provide.

Git is a distributed VCS, and we should support keeping it that way.

Almost any project you work on will have an authoritative copy of the repo in some kind of web-accessible tool, most of which provide a tarball-download function.

And GitHub's scheme is pretty much a de-facto standard at this point—GitLab's implementation is an exact copy of it, for example:

    https://<host>/<org/project>/archive/<ref/branch/tag>.tar.gz
Edit to add: Also, git-archive --remote is actually most of the way there, but it's not an HTTP download, of course. :(
GitHub doing something one way and GitLab copying it doesn't make a standard.
Careful, with extra large repositories it actually slows down the cloning while, obviously, significantly reducing the space usage.