On GitHub, I use the email address alex@gnu.org for my commits. Setting your name and email on the development machine is one of the first things you do when you start using git. This is specially important since these days development machines usually are not part of the mail network and thus there is only local mail delivery, if at all. This is why – and slowly we are getting to the point I’m trying to make – a new laptop comes with a broken domain, most of the time: localhost.localdomain. Thus, on a new laptop, on this new laptop for example, my email address would be alex@localhost.localdomain. OK, so this is wrong, but who cares, right?
Well, git does. It records your name and email address for every commit. And it displays a little avatar for your commits, and it pulls the account name you provided and displays it for your email address (ignoring the name you provided in the commit).
And suddenly a person named *Sauerbraten* started committing to my repos. How was this possible? Those were my commits. They were made by `Alex Schroeder <alex@localhost.localdomain>` and the email address alex@localhost.localdomain was the registered email address of a person called Sauerbraten on GitHub.
Is Sauerbraten a poor soul that has had a misconfigured email address for years? Are they privacy conscious and use this fake email address to avoid spam? Are they cool pranksters sneaking their ways into all the commit histories of all the developers named Alex with misconfigured email Addresses? Nobody knows by my hat is off to you, Sauerbraten.
And for everybody else out there: Don’t forget to set your email address when you get a new development machine!
git config --global user.name "Not Sauerbraten" git config --global user.email "your@email.address"
Verify it!
git config --global --list
#Git
(Please contact me if you want to remove your comment.)
⁂
And when you (I!) inevitably forget to do this and push commits with bogus author information, fix it with an interactive rebase applying the “edit” action to each affected commit, and doing `git commit --amend --author="Author Name <email@address.com>" && git rebase --continue` until it stops working because the rebase is done. Then force-push the result (`git push --force-with-lease ...`), and let any collaborators know you’ve just made their lives slightly more difficult by necessitating that they rebase any branches they’ve made from the commits you just replaced in the history.
– Aaron 2018-03-03 11:32 UTC
---
Yes indeed. I think yesterday when I wrote that post I had discovered yet another Sauerbraten commit in my commit histories and had to do the interactive rebase dance and looked at the number of forks existing for those projects and wondering: how the hell do I contact these poor forkers of one-dev projects. Oh well.
– Alex Schroeder 2018-03-03 13:45 UTC