git拉取指定目录
git拉取指定目录:整个项目中的某一个文件夹。
https://zhuanlan.zhihu.com/p/310701669
引用
- 防治源链接失效
1,本地新建文件夹或者执行命令
mkdir newproject && cd newproject
2,目录初始化
git init
3,设置远程仓库地址
git remote add -f origin <origin_url>
4,设置sparse checkout模式,允许克隆子目录
git config core.sparsecheckout true
5,设置指定拉取的目录(*是通配符,!是反选;例如 clients/*表示clients目录下所有)
echo clients/html >> .git/info/sparse-checkout
6,拉取
git pull origin master

浙公网安备 33010602011771号