Скрипт автоматической загрузки с github.ru Настроить тут: https://github.com/[Project-name]/admin/hooks Перейти в "WebHook URLs" и добавить Url с параметрами
http://8.8.8.8/git_pull.php?site=site.ru&branch=new_branch
<?php echo "Git pull<br>"; $Branch = isset($_GET['branch'])? $_GET['branch']: "Body"; $site_name = $_GET['site']; $path_to_dir = '/var/www/nginx-sites/'.$site_name.'/github'; $cmd = "cd $path_to_dir && "; $cmd .= "git reset --hard HEAD && "; $cmd .= "git pull && "; $cmd .= "git checkout $Branch -f "; echo "$cmd<br>"; echo shell_exec ( $cmd );