當項目過大時,從服務器上拉取項目是件很頭疼的事情,那麼就說說怎麼只拉區某個或幾個文件夾至本地。
上代碼:
git clone -n [email protected]:test/test_platform.git
cd test_platform
git config core.sparsecheckout true
echo webapp/css >> .git/info/sparse-checkout
git checkout master
如果需要 check out 多個文件夾的話,以此類推。
echo webapp/js >> .git/info/sparse-checkout
echo webapp/img >> .git/info/sparse-checkout
最後繼續 執行命令,checkout 項目至本地
git checkout master
簡單實用,走起來吧!