Z
Z
zzmaster2017-05-05 19:28:21
git
zzmaster, 2017-05-05 19:28:21

Why isn't author replaced when a commit is made?

I'm developing a simple gimmick to send commits over the web. Other commands such as status, add -A - work, but when executed

git commit --author="User <[email protected]>" -m 'just commit'

get
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got '[email protected](none)')

When you run the same command from the command line, the commit succeeds on behalf of the author specified in the command. I suspect that the problem stems from the fact that git is installed as root, and the web call is made on behalf of Apache. But how to fix this thing - I have no idea.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zzmaster, 2017-05-06
@zzmaster

The call of three commands in one line worked:

git config user.email "[email protected]"; git config user.name "Your Name";git commit -m 'commit'

A
aol-nnov, 2017-05-05
@aol-nnov

But how to fix this thing - I have no idea.

sudo -i -u www-data
git config --global user.email "[email protected]"
git config --global user.name "Your Name"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question