Enable sparse checkout
git config --global core.sparseCheckout trueInitial the local repository
git init
git remote add origin <git-repo-url>Edit “.git/info/sparse-checkout” to add the relative path of the directory. Example:
echo "some/dir/" >> .git/info/sparse-checkoutPull corresponding branch. Example:
git pull origin master