Created
October 28, 2014 00:20
-
-
Save rohozhnikoff/0f3f678d585e7f302948 to your computer and use it in GitHub Desktop.
simple half-auto backup to git on php (just for concept)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
$default_branch = 'master'; | |
$message = 'auto-commit'; | |
if (isset($_GET['message']) && $_GET['message'] != '') { | |
$message = $_GET['message']; | |
} | |
$message .= 'from ' . date("Y-m-d H:i:s") | |
$results = array(); | |
$results[] = shell_exec('git add .'); | |
$results[] = shell_exec('git commit -am ' . $message); | |
$results[] = shell_exec('git push origin ' . default_branch); | |
echo '<pre>' . json_encode($results) . '</pre>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment