美文网首页
git Github 或gitlab 拉取指定文件夹或文件

git Github 或gitlab 拉取指定文件夹或文件

作者: 北京的天空 | 来源:发表于2020-05-11 20:17 被阅读0次

1.CD 到指定文件夹

创建一个空的本地仓库

git init

连接远程仓库GitHub

2.添加远程git(此方法会来去git分支信息)

git remote add -f origin <url>

3.开启sparse checkout 模式

git config core.sparsecheckout true

4.告诉Git哪些文件或者文件夹是你真正想Check Out的

echo libs >> .git/info/sparse-checkout  

其中libs是你想要的文件夹
5.最后一步,拉取想要的分支

git pull origin master(or other)

相关文章

网友评论

      本文标题:git Github 或gitlab 拉取指定文件夹或文件

      本文链接:https://www.haomeiwen.com/subject/hyppnhtx.html