r/github • • May 26 '25
Discussion Friendly reminder you can make your email address private
Hi all! This came up in conversation with a friend and I realized more people might benefit from knowing this.
- Anyone can view your email address from your git history with
git log - GitHub offers
noreplyemail addresses you can use in place of your personal email address to keep it private. - This is very commonly overlooked! Reading the
git logfrom any popular repository on GitHub will reveal personal email addresses from contributors. If this is news to you, you might be one of them!
Why does this matter?
I'm writing this with the assumption you're at at least a little privacy conscious and care about reducing your digital footprint. I understand not everyone exercises the same paranoia. If this doesn't apply, please disregard at your own discretion.
If you've ever shared a your GitHub or linked to it from your socials, you may not be aware that you're making it easier for anyone to know your personal email address. This is because all git commits you make will likely include your personal email address. This is often overlooked and makes it more easy for bad actors to get access to your personal information to target it for spam or other nefarious purposes.
How can I update this?
- Go to your Email Settings page in your GitHub account and select the box that says "Keep my email address private".
- Copy the
noreplyemail address listed in the settings. This will usually look likeID+USERNAME@users.noreply.github.com. - Follow the Setting your commit email address GitHub doc for instructions on updating your email address used for git commits. Make sure to use the
noreplyaddress, not the primary account email as mentioned in the docs. - Optionally, you can additionally configure GitHub to block command line pushes that expose your personal email address so you avoid accidental exposure in the future.
What about old commits?
Unfortunately, old commits you've made will still contain your personal email address. You can refer to guides such as this StackOverflow answer for updating old commits (individually or the entire history) but this may cause other issues, especially for code you've already pushed. Any Pull Requests you've completed prior to updating will also still contain your old email email in that repositories history.
Fortunately, you are still only a single drop in a the data lake among many many others who have probably overlooked this as well. No one cares and you're not special (in a good way!). Updating this is still better than continuing to expose your personal email and will still make it harder for people to find it buried under old commits.
4
u/[deleted] May 26 '25
Sorry for the blurry image. It was better before reddit compressed it lol
5
u/littleblack11111 May 26 '25
Nope, if you already contributed to repos and have ur email in the commits.
5
u/rekire-with-a-suffix May 26 '25
I am aware that the committer email address is public. However out of my experience this is not abused a lot. I got in the last 12 years might be about 5 recruiter mails and one crypto scam mail. That's okay. However I also use a separate email address for committing therefore I can detect it. By the way I have 70 public repos, there for there should be enough room for a leak đ
1
u/elephantdingo May 26 '25
I hope not.
Your public commits are out there. The code or changes are out there. Your name is on the commit. You also had to manually add your name and your email once upon a time. How do you overlook that?
Commit identity is intentionally contact information. Thatâs what itâs for.
And why do we need a shitty GitHub no-reply addresses? I can set it to
noreply@fuckoff.fuif I want. Although maybe GitHub throws up on itself if you try to use an email that you donât own and that doesnât exist. Ironically enough?Further. It becomes a virtual no-brainer to set it to something nonsensical like that. Because now you can commit and send it wherever. You donât need a webservice to rewrite your commits to change your email. Just donât use your email to begin with...
1
u/gg213866 Sep 02 '25
Thanks for the information , but a question should I copy the whole address including numbers before the "+" or just the part after the is enough "+" (It may be a dumb question but i think a lot sorry)
1
u/[deleted] Nov 27 '25
got doxxed from this, thought I was safe when I removed it from the commit message
1
u/loomster9239 Dec 17 '25
I was trying to figure this out, and this post is really helpful. Thanks!
1
u/neon_overload Dec 29 '25
This is good information to know but for people privacy conscious enough for this to matter, I think using the GitHub anonymous email addresses is a poor solution.
It unnecessarily and somewhat permanently would tie me to GitHub, a proprietary and Microsoft controlled git host. Let's not forget that GitHub is not git, and I want to reserve the right to abandon GitHub as a git host in future without keeping any ties to it.
Also, I realize I am already giving up a lot of my stuff to Microsoft's big pile of AI training data by hosting on GitHub already, so this point may seem trivial, but handing them the ability to see my email correspondence as well, which may include emails from people interested in my work whether they see it on GitHub or elsewhere, just seems unnecessary.
What seems like a better solution is using some email address that doesnt give away anything about my identity but which I still control. Whether that's some other email anonymiser not tied to Microsoft, or an email account that I myself control but is just separate and can't easily be connected to my personal one.
-4
u/JontesReddit May 26 '25
Emails are supposed to be public.
-2
u/[deleted] May 26 '25
[removed] â view removed comment