git/list[1] front-page[2] threads[3] people[4] search[5] about
 

"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
Next: Junio C Hamano
Message 1 of 10 in “"commit --author=..." does not work if global email and name is not set”
  1. Piotr KrukowieckiApr 5, 2019
  2. Junio C HamanoApr 5, 2019
  3. Jakub NarebskiApr 6, 2019
  4. Junio C HamanoApr 8, 2019
  5. Piotr KrukowieckiApr 8, 2019
  6. Jakub NarebskiApr 8, 2019
  7. Piotr KrukowieckiApr 8, 2019
  8. Junio C HamanoApr 9, 2019
  9. Piotr KrukowieckiApr 9, 2019
  10. Jakub NarebskiApr 9, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.