I'm trying to commit some changes as a different user, but i do not have a valid email address, following command is not working for me:
git commit --author="john doe" -m "some fix"
fatal: No existing author found with 'john doe'
git commit --author="john@doe.com" -m "some fix"
fatal: No existing author found with 'john@doe.com'
standard A U Thor <author@example.com> format
The
standard A U Thor <author@example.com> format
Seems to be defined as followed: ( as far as i know, with absolutely no warranty )
A U Thor = required username
<author@example.com> = optional email address
If you don't use this exact syntax, git will search through the existing commits and use the first commit that contains your provided string.
Examples:
Only user name
Omit the email address explicitly:
git commit --author="John Doe <>" -m "Impersonation is evil."
Only email
Technically this isn't possible. You can however enter the email address as the username and explicitly omit the email address. This doesn't seem like it's very useful. I think it would make even more sense to extract the user name from the email address and then use that as the username. But if you have to:
git commit --author="john@doe.com <>" -m "Impersonation is evil."
I ran in to this when trying to convert a repository from mercurial to git. I tested the commands on msysgit 1.7.10.