This is a distillation of a technique we use internally at Basho to reduce the pain of cloning some of our larger repos. It relies a bit on shell scripts and environment variables, but it can be run more directly, as I show below.
-
Create a bare git repository in some directory, e.g.
/var/lib/gitcache
.git init --bare /var/lib/gitcache
-
Add all repositories you want to cache as remotes to the git repository, e.g.