Web lists-archives.com

"commit --author=..." does not work if global email and name is not set


I have a repo downloaded on machines which do automatic tests.
Sometimes I want to make a quick fix there and push back to origin.
Reading git-commit docs I had impression that I can use "--author=me"
and it will work. But it requires setting global user name and email:

$ git commit --author=pkruk

*** Please tell me who you are.


  git config --global user.email "you@xxxxxxxxxxx"
  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 'some@default.(none)')

I do not want to set the default name/email, because I want commits to
have real names, and not some "automatic test account" info. For
pushing back to origin I already have to use a read-write SSH key, but
lack of default name/email would prevent accidental commits (people
WILL forget to use --author ...).

Do you think changing git to not require default name/email if
"--author" is specified is possible (and hopefully easy and quick to
implement ;))?


Piotr Krukowiecki