Domenic Domenic - 1 month ago 7
Git Question

"Alias" git authors/committers?

So I've managed to commit to a GitHub project as both

domenic <domenic@domenicdenicola.com>
and
Domenic Denicola <domenic@domenicdenicola.com>
. This is annoying, especially for generating summaries.

I know about how to change the authors/committers retroactively. However, this has lots of undesirable consequences for a project that is already pushed and public, e.g. changing all the hashes (and thus invalidating links to them people have made, or comments on them); losing the tags; and I'm afraid GitHub might even end up appending "committed 5 minutes ago by Domenic Denicola" to every single commit in the project. So that's not an option.

I was hoping there was some way to tell Git, "these two authors/committers are exactly the same person; count them as such." Is there?

Answer

Set up a .mailmap file in your repo. See git help shortlog for details, or check out the one for Git itself.

See Mapping authors section: https://git-scm.com/docs/git-shortlog#_mapping_authors

Comments