Skip to content

Instantly share code, notes, and snippets.

@daneden
Last active August 29, 2015 14:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daneden/5a3f7b8531e0b46d7ef9 to your computer and use it in GitHub Desktop.
Save daneden/5a3f7b8531e0b46d7ef9 to your computer and use it in GitHub Desktop.
<?php
// Navigate to the git repo on the server
$command = 'cd /location/of/design-cabin-repo/ ';
// Pull changes
$command .= '&& git pull ';
// Sync changes to the Dropbox folder, deleting files that aren't present in the repo and excluding select files
$command .= '&& rsync ./* /location/of/Dropbox/Design\ Cabin/ --delete --exclude=".git"'
if($output = shell_exec($command)) {
echo "<pre>$output</pre>";
} else {
echo "Something went wrong!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment