Skip to content

Instantly share code, notes, and snippets.

@jk2K
Forked from cowboy/github_post_recieve.php
Created September 21, 2015 08:31
Show Gist options
  • Save jk2K/b5b47f659ef76a1d6ec1 to your computer and use it in GitHub Desktop.
Save jk2K/b5b47f659ef76a1d6ec1 to your computer and use it in GitHub Desktop.

Revisions

  1. @tavori tavori revised this gist Sep 21, 2015. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions github_post_recieve.php
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,6 @@
    // 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
    shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull 2>& 1' );
    echo 'success';
    }
  2. @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