How can I check that or set that?
Go to your repository folder, and type:
git config -l --show-origin --show-scope
You will see all settings, with their scope and location. If there is one closer to the repository with your system name, it would take precedence over the global settings.
Check also for user environment variables, like "Committing":
- GIT_AUTHOR_NAMEis the human-readable name in the “author” field.
- GIT_AUTHOR_EMAILis the email for the “author” field.
- GIT_COMMITTER_NAMEsets the human name for the “committer” field.
- GIT_COMMITTER_EMAILis the email address for the “committer” field.
Those would also take precedence over the global settings.
For existing commits, you can use git filter-repo (to be installed first) "User and email based filtering":
cd repo
git filter-repo --mailmap my-mailmap
with my-mailmap:
Correct Name <correct@email.com> <old@email.com>