配置项目提交到git的时候自动同步服务器代码 一、在服务器项目跟目录新建文件hook.php 代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 <?php $json = file_get_contents("php://input"); $data = json_decode($json,true); if (isset($data['ref']) && $data['total_commits_count']>0) { $res = PHP_EOL."pull start ---------------------------------------------".PHP_EOL; $res