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

`git commit` with the `--author` option

From
GPGlen Peterson <glen.k.peterson@gmail.com>
Date
Jan 14, 2022, 20:24 UTC
Message-ID
<CA+LnoU=MwKiyY6+MUWUj=SpgGrg2RVabNY_vtBbBicAsW2ZzjA@mail.gmail.com>

Thank you for git! I use it hourly. It is orders of magnitude better than vcs, cvs, subversion, clearquest, sourcesafe, and a number of others I have used, but can't remember right now.

I was excited to see the `--author` option on the `git commit` command, thinking that I could use it to set arbitrary authors for git commits. Reading the docs, I expected to use it to, "Specify an explicit author using the standard A U Thor _author@example.com_ format."

It seems from stackoverflow and this list that git won't do that unless you have an author specified in your config somewhere (`git config user.email` and `git config user.name`)? Links to sources available on request (your system rejected my first email).

Does the email you set in the `--author` option have to match the one in your config, or can you set it to anything once you have a random user.email in your config? Is this option just for choosing between pre-configured emails?

I think this option would be much more useful if it worked without also setting your git config.

Next: brian m. carlson
Message 1 of 2 in “`git commit` with the `--author` option”
  1. Glen PetersonJan 14, 2022
  2. brian m. carlsonJan 14, 2022

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.