git中Sparse Checkout模式

如何从仓库里拉取指定的部分文件呢?可以使用Sparse Checkout模式

  1. 先用git init创建个空白的本地仓库
  2. 再使用git remote add -f origin 添加远程仓库
  3. git config core.sparsecheckout true 启用Sparse Checkout模式
  4. 在.git/info/sparse-checkout文件里指定需要的部分文件或文件夹,一行表示一项。
  5. git pull origin master 以正常的命令拉取即可。

猜你喜欢

转载自blog.csdn.net/Tifa_Best/article/details/84025553