PHP Exec Git Pull


Hello! I need a script to run git pull. I tried this:

$output = array();
echo exec(“git pull”, $output);
echo 'Output: ’ . print_r($output, true);

but it didn’t output anything at all. Any better idea on how to either use a PHP script and/or use another language (Python perhaps?)



Are you trying to script this from commandline or from the web?


Also: What are you trying to do here? If you’re trying to set up automatic deployment, you may want to look into existing deployment tools like Capistrano rather than trying to build your own.