http://schacon.github.io/git/git-read-tree.html#_sparse_checkout

 

Existing Repository

 

If you already have a repository, simply enable and configure sparse-checkout as above and do git read-tree.

  1. Enable sparse-checkout:

    git config core.sparsecheckout true
  2. Configure sparse-checkout by listing your desired sub-trees in .git/info/sparse-checkout:

    echo some/dir/ >> .git/info/sparse-checkout
    echo another/sub/tree >> .git/info/sparse-checkout
  3. Update your working tree:

    git read-tree -mu HEAD

 

 

可以略过第二步

1.   git config core.sparsecheckout true

2   Update your working tree:

git read-tree -mu HEAD

3

git checkout [branch] -- fileName

 

相关文章:

  • 2021-07-03
  • 2021-09-05
  • 2021-10-26
  • 2022-02-14
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
猜你喜欢
  • 2021-10-10
  • 2021-09-24
  • 2022-03-05
  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
相关资源
相似解决方案