Git global config issue when run through script

Viewed 2705

I have a PHP script with a web interface which is used to provide input into a process which is now automated. I am attempting to include committing and pushing to Git in this process by executing git commands through PHP's exec. I am able to pull in the remote repository, add files and get the status of it. However, I am running into an issue when attempting to commit my changes.

When I attempt to commit, I get:

[0] => 
[1] => *** Please tell me who you are.
[2] => 
[3] => Run
[4] => 
[5] =>   git config --global user.email "you@example.com"
[6] =>   git config --global user.name "Your Name"
[7] => 
[8] => to set your account's default identity.
[9] => Omit --global to set the identity only in this repository.
[10] => 
[11] => fatal: unable to auto-detect email address (got 'tim@tim.(none)')

It is my understanding that Git is not resolving my global config at ~/.gitconfig, which it can do when executed normally through a Terminal. I have Apache running under my user and group. When I attempt to run the commands suggested above, I get:

[0] => fatal: $HOME not set

How can I resolve this?

1 Answers
Related