很多时候我们不需要clone整个项目,只想要clone其中某个子目录,只需要几步就可以实现:
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 main
标签:origin,info,git,clone,子目录,echo
From: https://www.cnblogs.com/chaichengxun/p/17011535.html