Category: Tools

How to hide your email from users on GitHub

Committer’s emails can be seen in git log. How can I solve this problem?

GOAL

To hide the committer’s email in GitHub.

Method

Use the noreply email address that is assigned to hide the committer email address. The GitHub-provided noreply email address is defined as ID+username@users.noreply.github.com.

Reference: Setting your commit email address

1. Check “Keep my email addresses private”

Open “Settings” and open Emails tab.

Check “Keep my email addresses private”. Then you can use the noreply email address that is displayed. This address can be used for web-based Git operations (e.g., edits and merges).

2. Check “Block command line pushes that expose my email”

If you check this check box, commits that use a private email address will be blocked.

3. Change the local git user.email to the commit email address

If you want command line Git operations to use the noreply email address, you must set your email in Git.

> git config --global user.email "ID+username@users.noreply.github.com"