git 指定下载文件,目录

1、创建路径
mkdir gitfile
cd <路径> 
eg:cd /home/gitfile/
2、创建一个空的本地仓库
git init
3、连接远程仓库GitHub
git remote add -f origin 
eg:git remote add -f origin http://kf-gitlab-166/workspace/demo.git
4、开启sparse checkout 模式
git config core.sparsecheckout true
5、告诉Git哪些文件或者文件夹是需要下载的(作为列表保存在 .git/info/sparse-checkout 文件中)
指定demo目录如下:
echo demo >> .git/info/sparse-checkout
6、拉取想要的分支
#git pull origin master

参考
https://blog.csdn.net/heguangsui123/article/details/102959346

你可能感兴趣的:(学习笔记,git,github)