For large code repository, if just want to see and learn some of the source code, selectively download code section path becomes very practical, so you can save a lot of waiting time. Such as Chromium this, the size of several G is warehouse. clone warehouse under the code portion of the path in three stages,
$ git init <repo>
$ cd <repo>
$ git remote add -f origin <url>
$ git config core.sparseCheckout true
$ echo "some/dir/" >> .git/info/sparse-checkout
$ echo "another/sub/tree" >> .git/info/sparse-checkout
$ git pull origin master
Directory deletionsIf you want to follow the path additions and deletions, directly edit the $ vi .git/info/sparse-checkout
$ git read-tree -mu HEAD
# 或
$ git read-tree --dry-run HEAD
Switch to full modeIf the day did not want to get part of the code, and want to pull the complete code for the entire warehouse, as such, edit /*
And then perform related resources |
git clone part of the code repository
Guess you like
Origin www.cnblogs.com/Wayou/p/git_sparsecheckout.html
Recommended
Ranking