We have a PHP script which consists of nothing but the following code...
/usr/bin/git pull
...we originally were using just git pull
.
Whenever GitHub posts data to this script the git pull
fails. We've tried using http://us2.php.net/manual/en/function.shell-exec.php and storing the response in a variable and writing the content of that variable into a text file so we could make sure commands were being executed - and they were! We could execute for example git log
and the text file would have all content of the git log response. But executing git pull
just doesn't work?
Our server engineers suggested using the full path to the git install (using which git
to find the path) and that is what you see above, but that too didn't work.
We're confused as to why we can execute git commands such as git log
when GitHub's post-hook calls our script but yet git pull
doesn't work?
Does any one have any ideas on why this wouldn't work?
Thanks.