有一个包含多个子目录(lib/Android 和 lib/iOS)的远程存储库。我可以只在 lib/Android 中创建子树吗?
问问题
365 次
1 回答
2
是的,你可以使用sparse checkout
git 1.7.0 中添加的。
例如:
初始化回购
mkdir git-subdir
cd git-subdir
git init
启用稀疏检出
git config core.sparsecheckout true
告诉 Git 你想要哪些目录
echo "some/dir/" >> .git/info/sparse-checkout
添加遥控器
git remote add -f origin https://github.com/git/git.git
拉
git pull origin master
于 2014-08-20T02:48:50.230 回答