Check to see if a Git repository is up to date
Added by astuffedtiger on May 16, 2017 17:55
<?php
$gitpull = exec('cd /home/git/git-repository ; /usr/local/bin/git pull origin');
if ($gitpull == "Already up-to-date.") {
    echo "$gitpull - Up to date.";
        exit();
    }
    else {
        echo "$gitpull - Not up to date.";
	exit();
    }
?>

Comments