Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Forked from p4ul/pull-updates.php
Last active December 21, 2015 01:38
Show Gist options
  • Save clouddueling/6228614 to your computer and use it in GitHub Desktop.
Save clouddueling/6228614 to your computer and use it in GitHub Desktop.
<pre>
<?php
// ---------------------- CONFIG DETAILS ----------------------
//branch in git
$BRANCH = 'master';
// --------- You should not need to edit below here ------------
$current_sha1 = `git rev-parse $BRANCH`;
$status_of_branch = `git ls-remote origin -h refs/heads/$BRANCH`;
if( strpos(trim($status_of_branch), trim($current_sha1)) !== false) {
echo "no changes on branch $BRANCH \n";
return;
}
echo "Pulling\n";
$pull = `git pull`;
echo ".\n";
echo "Clearing Cache\n";
// clear out storage/work and storage/views
echo ".\n";
echo "Finished \n";
echo "pull:". $pull , "\n";
$sha1 = `git rev-parse $BRANCH`;
$changelog = `git log $BRANCH -1 --format="%s"`;
echo "sha1:". $sha1 , "\n";
echo "changelog:".$changelog , "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment