How does git know my email?
git log correctly shows my full name and email address in the commit log. I don’t remember ever telling git who I was. Have I just forgotten or does git get this information from somewhere else? (Linux)
3 Solutions collect form web for “How does git know my email?”
It’s (likely) configured in the global git config.
You can verify it by running
git config --global --get user.email
Or more in general, you can list the entire global configuration with
git config --global -l
You probably configured it a long time about and forgot about it since then.
Check your email configuration by:
git config --list
In almost case, setup email address correctly is necessary:
git config user.email "firstname.lastname@example.org"
Email is the first criteria for user identification.
You may not have explicitly given git your address. The
git commit-tree documentation describes how git approximates your attribution when all details are not known.
While parent object ids are provided on the command line, author and committer information is taken from the following environment variables, if set:
\ncharacters are stripped.)
In case (some of) these environment variables are not set, the information is taken from the configuration items
user.email, or, if not present, the environment variable
/etc/mailnameand falling back to the fully qualified hostname when that file does not exist).