I’ve been working with an Open Source project called NetHunter. For those who are into the InfoSec side of things, you may have heard of Kali-Linux. NetHunter is a project to bring Kali to select android devices. The project is run by Offensive Security which is the same organization that develops/funds Kali Linux.
My goal was to setup Jenkins for continuous integration. While tweaking the setup/configuration, the jenkins installation was running in a virtual machine within my home lab. Unfortunately, my home internet is horrendously slow (I live in a sparsely populated area) and doing the initial git clone takes a fair amount of time. I have jenkins configured to start with a clean environment each time, which means it has to do a full git clone for every job it runs. Due to the internet/bandwidth issues, this quickly became fairly painful.
In exploring around to see if there was a way I could speed up this initial clone, I stumbled across
git clone --reference in one of the git manpages.
It took a few minutes of experimentation to get it to work, but work it did! I was now able to do the initial clone from a local git cache on the machines hard drive!