I'm creating a deployment script for github, written in PHP. I'm using the shell_exec
command to run git pull
which works fine.
My issue occurs when there is an error with the pull. If I do it in Terminal, I get the full error. For example:
git pull origin master
Updating f706749..8468d24
test.txt: needs update
error: Entry 'test.txt' not uptodate. Cannot merge.
But when I run the same command in shell_exec
the output is truncated to just
Updating f706749..8468d24
test.txt: needs update
The error message is getting cut off, possibly because it's a response from the previous response. Is there a way to return the full output?