Guide
How to use a GitHub noreply email for git commits
Published
Every git commit records an author email. If that’s your personal address, it ends up in every public repository you push to, and in your local git config, where any AI coding agent working in your project can read it. GitHub gives every account a private noreply address you can use instead.
1. Find your noreply address
- On GitHub, open Settings → Emails.
- Turn on Keep my email addresses private.
- GitHub shows your noreply address under that option. It looks like
ID+USERNAME@users.noreply.github.com, whereIDis a number.
Accounts created before July 18, 2017 may have an older address without the number, in the form USERNAME@users.noreply.github.com. Use exactly what the settings page shows.
2. Use it in git
Set it as your default for all repositories:
git config --global user.email "ID+USERNAME@users.noreply.github.com"
Or only for the repository you are in:
git config user.email "ID+USERNAME@users.noreply.github.com"
Check what git will use:
git config user.email
3. Block pushes that expose your email (optional)
On the same Settings → Emails page, turn on Block command line pushes that expose my email. GitHub will then reject pushes with commits that use your private address.
What this does and doesn’t do
- New commits use the noreply address. Commits you already made keep their old email. Changing them means rewriting history, which is usually not worth it for public repositories that others have cloned.
- Your GitHub account email stays the same for notifications and sign-in.
- An AI agent that reads your git config will now see the noreply address, not your personal one. It may still know your email from other sources, such as its own account context. Test your tool with Agent Leak Test.
Find out in about a minute. Free, no sign-up, results deleted after 1 hour.
Run the Agent Leak Test