";
// Checks start
if(function_exists('exec')) {
echo "exec is enabled";
}
echo "
";
echo exec('whoami');
echo "
";
echo exec('which git');
echo "
";
// Checks end
$repositoryPath = '/path';
// Set the branch you want to pull from
$branch = 'development';
$result = exec("cd {$repositoryPath} && sudo git pull origin {$branch} 2>&1", $r2);
echo "
"; 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 ""; foreach ($r2 as $line) { echo $line . "\n"; }