Git单独checkout子目录

 

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

 

posted on 2016-01-22 13:28  smartch  阅读(1723)  评论(0编辑  收藏  举报