How to clone a sub-directory only of a Git respository

 mkdir <repo>

cd <repo>

git init

git remote add -f origin <url>

git config core.sparseCheckout true

echo "some/dir/" >> .git/info/sparse-checkout

echo "another/sub/tree" >> .git/info/sparse-checkout

git pull origin master


-Reference

https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository

+ Recent posts