PHP文件执行拉取git代码-git自动同步

使用PHP文件拉取git更新
1.PHP文件内容:

<?php
system('/bin/bash ../../update.sh');
system('/usr/bin/git log -n 1|head -n 1');

2.sh脚本内容(update.sh):

#!/bin/bash
bin_git=/usr/bin/git
branch=develop

$bin_git checkout $branch
$bin_git pull origin $branch

One Comment

Leave a comment