I spent lots of hours on it when I call PHP script to init and commit to git.
And I found the work flow should be as:
git init
git config user.name “someone”
git config user.email “[email protected]”
git add *
git commit -m “some init msg”
If you swap [23] and 1, the config will not work at all.
I wish this will do some help.
Instead of doing a git pull, you can do:
git fetch
git reset –hard origin/master
Neither of those require you to configure your git user name / email.
This will destroy any uncommitted local changes / commits, and will leave your HEAD pointing to a commit (not a branch). But neither of those should be a problem for an app server since you shouldn’t be making local changes or committing to that repository.