1. 程式人生 > >利用git 從github下載指定檔案或資料夾

利用git 從github下載指定檔案或資料夾

1.在Config中允許使用Sparse Checkout模式:

$git config core.sparsecheckout true

2.接下來你需要告訴Git哪些檔案或者資料夾是你真正想Check Out的,你可以將它們作為一個列表儲存在 .git/info/sparse-checkout 檔案中。 
例如:

$echo “libs” >> .git/info/sparse-checkout
$echo “apps/register.go” >> .git/info/sparse-checkout
$echo “resource/css” >> .git/info/sparse-checkout

3.最後,你只要以正常方式從你想要的分支中將你的專案拉下來就可以了:

$git pull origin master


作者:gece
連結:https://www.zhihu.com/question/25369412/answer/96174755
來源:知乎