git clone指定文件和目录

作者: zengde 分类: 笔记 发布时间: 2020-04-09 02:03
mkdir <repo>
cd <repo>
git init
git remote add -f origin <url>
git sparse-checkout init
# same as: 
git config core.sparseCheckout true

git sparse-checkout set "A/B"
# same as:
echo "A/B" >> .git/info/sparse-checkout

git sparse-checkout list
# same as:
cat .git/info/sparse-checkout