composer install package:dev-master, vendor 有 .git 目录处理

比如这个包:

composer require "thetispro/laravel5-setting:dev-master"

装了后 vendor/thetispro/laravel5-setting 目录下会有 .git 目录, 包含了作者的 git 信息, 这时候可能会跟我们自己的 git 出现冲突

解决办法, 利用 composer 自带的钩子解决

{
...
"post-install-cmd": [
     "echo '[WARNING] Delete vendor all git dirs'",
     "rm -rf vendor/**/**/.git",
     ...
]
"post-update-cmd": [
    "echo '[WARNING] Delete vendor all git dirs'",
    "rm -rf vendor/**/**/.git",
     ...
]
...
}

你可能感兴趣的:(composer install package:dev-master, vendor 有 .git 目录处理)