Checking out a individual folders (or files) of a Git repository
git init
git remote add origin $URL
git config core.sparsecheckout true
git sparse-checkout set $DIR #check with git sparse-checkout list
git pull origin $BRANCH
From the mind (and hands) of Chris Gwilliams
git init
git remote add origin $URL
git config core.sparsecheckout true
git sparse-checkout set $DIR #check with git sparse-checkout list
git pull origin $BRANCH