呼啦一阵风
对于基于Composer的PHP项目,您可以自动分发给工程师。以下是预提交和commit-msg挂钩的示例。创建一个hooks文件夹,然后在你的composer.json中: },
"scripts": {
"post-install-cmd": [
"cp -r 'hooks/' '.git/hooks/'",
"php -r \"copy('hooks/pre-commit', '.git/hooks/pre-commit');\"",
"php -r \"copy('hooks/commit-msg', '.git/hooks/commit-msg');\"",
"php -r \"chmod('.git/hooks/pre-commit', 0777);\"",
"php -r \"chmod('.git/hooks/commit-msg', 0777);\"",
],然后你可以随着项目的继续更新它们,因为每个人都composer install在定期运行。