1.vendor目錄已經存在
如果已經執行了composer update/install,需要先刪除vendor目錄 執行:rm -rf vendor
git add -A
git commit -m "remove vendor"
composer update --prefer-dist
git add . -A
git commit -m "recover vendor"
2.vendor目錄不存在
composer update --prefer-dist
git add . -A
git commit -m "recover vendor"
Notice: composer update –prefer-dist 優先從快取取,不攜帶元件內的.git目錄。