Reputation: 112807
So I've managed to commit to a GitHub project as both domenic <[email protected]>
and Domenic Denicola <[email protected]>
. 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?
Upvotes: 33
Views: 7280
Reputation: 363487
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
Upvotes: 36
Reputation: 236
If your email used to submit is different than the email associated with your account, you can add the additional email at https://github.com/settings/emails.
I had this problem when using Source Tree to commit to GitHub. It submits using the name: pcuser@pcFQDN, which is not my email address. Adding this false address to my GitHub account made all of my commits show as me. It does not require that the address be verified.
Upvotes: 4