ref: https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository
first arg: repo url seccond arg: dir to clone into all following args: paths to be checked out from the repo
function git_sparse_clone() (
rurl="$1" localdir="$2" # all following args are paths to checkout from the repo
mkdir -p "$localdir"
git clone -n --depth=1 --filter=tree:0 "$rurl" "$localdir"
cd $localdir
git sparse-checkout set --no-cone $@
git checkout
)