From the mind (and hands) of Chris Gwilliams

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