"commit --author=..." does not work if global email and name is not set
- From
Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
- Date
- Apr 5, 2019, 07:34 UTC
- Message-ID
- <CAA01Csp7y9=2n9=TNYMMw9LUO_cENz7FBeZjFrUd2FvHFT9NCQ@mail.gmail.com>
Hi,
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.
Run
git config --global user.email "you@example.com" 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 ;))?
Thanks,
-- Piotr Krukowiecki