Last active
August 26, 2021 06:10
-
-
Save serverok/7efc12fcd75aac21309dbe234d9030f6 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
# Author: Yujin Boby | |
# Web: https://serverok.in/php-script-to-pull-changes-from-git-repository | |
# Email: admin@serverOk.in | |
# This script pull latest code from git. | |
$pw = isset($_GET["pw"]) ? $_GET["pw"] : ''; | |
if ($pw != 'YOUR_PASSWORD_HERE') { | |
die("Invalid password"); | |
} | |
$result = exec("git pull origin main 2>&1", $r2); | |
echo "<pre>"; | |
foreach ($r2 as $line) { | |
echo $line . "\n"; | |
} | |
unset($r2); | |
echo "\n\n"; | |
echo "------------------------------------------------------"; | |
echo "\ngit status\n"; | |
echo "------------------------------------------------------"; | |
echo "\n\n"; | |
$result = exec("git status 2>&1", $r2); | |
echo "<pre>"; | |
foreach ($r2 as $line) { | |
echo $line . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment