Skip to content

Instantly share code, notes, and snippets.

@dyaa
Forked from cowboy/github_post_recieve.php
Created May 1, 2014 21:17
Show Gist options
  • Save dyaa/b74dd556ae89583b205d to your computer and use it in GitHub Desktop.
Save dyaa/b74dd556ae89583b205d to your computer and use it in GitHub Desktop.
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment