2 ms·
In a previous sysadmin job, I've had to deal with major network performance bottlenecks between our CI lab and the company's uplink, where all our git clones/pu
by boricj 2y ago
In a previous sysadmin job, I've had to deal with major network performance bottlenecks between our CI lab and the company's uplink, where all our git clones/pulls went through. I had to improvise a solution, so I wrote a Git proxy/cache in bash.
You set up that script as a login shell for a SSH account. Each client is configured with git-config's url.<base>.insteadOf to rewrite Git URLs to go through this SSH endpoint. The script then either clones or pulls from the remote and then serves the client by exec()'ing git-upload-pack from the local copy.
One side effect is that this Git proxy/cache accumulates a complete local copy of everything that was ever cloned or pulled through it. Configure your development system to use it and you have yourself a remote server with an on-disk mirror that tracks everything you've cloned or pulled.
I haven't used this personally in years, but it's still in production as far as I know at my previous job. You can find that script here: https://gist.github.com/boricj/909d3df166af8c5c2fe9fa66bdce8b72 https://gist.github.com/boricj/909d3df166af8c5c2fe9fa66bdce8...