PHP Exec Git Pull


#1

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

[php]<?php
$output = array();
echo exec(“git pull”, $output);
echo 'Output: ’ . print_r($output, true);
[/php]

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?)

Thanks!


#2

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


#3

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.