Skip to content

Instantly share code, notes, and snippets.

@rom3r4
Created May 20, 2014 11:22
Show Gist options
  • Save rom3r4/7df61812ed485a8bd4ed to your computer and use it in GitHub Desktop.
Save rom3r4/7df61812ed485a8bd4ed to your computer and use it in GitHub Desktop.
gitlab webhook (autopull)
<?php
$DIR="/var/www/vhost/____change_me______";
$GIT=$DIR."/.git";
$output = exec("/usr/bin/git --git-dir=". $GIT ." --work-tree=" .$DIR ." pull origin master");
#$output = shell_exec("id");
echo "<pre>". $output ."</pre>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment