Skip to content

Instantly share code, notes, and snippets.

@dulumao
Forked from cowboy/github_post_recieve.php
Created June 17, 2016 09:36
Show Gist options
  • Save dulumao/4b654de3248969db655c493b97c8bfe2 to your computer and use it in GitHub Desktop.
Save dulumao/4b654de3248969db655c493b97c8bfe2 to your computer and use it in GitHub Desktop.

Revisions

  1. @cowboy cowboy created this gist Oct 11, 2010.
    9 changes: 9 additions & 0 deletions github_post_recieve.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <?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