下载整个仓库

1
$ git clone https://github.com/Yangfan2016/PersonalWorks.git

下载仓库内的指定文件

1
2
3
4
5
6
7

$ git init
$ git config core.sparseCheckout true # 配置
$ git remote add -f origin https://github.com/Yangfan2016/PersonalWorks.git
$ echo "static-page/" >> .git/info/sparse-checkout # 写入要下载的文件目录
$ echo "web-app/" >> .git/info/sparse-checkout
$ git pull origin master