GitHub is where developers share their code, work on open-source projects, and collaborate with others. 👨💻
It is one of my favorite platforms to share my work and even collaborate on school and real-world projects.
So, today I'll share a GitHub feature that I don't see many people utilizing.
When you collaborate on GitHub whether it be on your own personal project or on some open-source project, your commit email address is public and is visible to everyone.
In order to see anyone's email address all you have to do it to open a commit and add
.patch at the end of the URL in the browser and press Enter.
The information associated with the commit will be displayed. This includes the changes made (insertions and deletions), the username of the person who made the commit and yes, the email address associated with their GitHub account.
In this example, I have used
Brad Traversy's GitHub account as an email since his email address is already public so showing it will not have any problems (I hope 😅).
Now, if you are privacy conscious and don't want your email address to be public and visible to everyone, GitHub provides an option of private email address.
All you have to go is head over to the settings and navigate to Email section. Then check the Keep my email address private and the Block command line pushes that expose my email.
Once this setting is turned on, GitHub will remove your public email address and use a GitHub issued
no-reply email address as your commit email address.
Furthermore, you can also tell GitHub to block command line pushes that use your private email address. You can see your no-reply email address in the Emails section. It will typically look like this:
your_id + your_github_username @ users.noreply.github.com
Since, my username is
codewithfahad, my no-reply email address is:
Now all you have to do is to configure git to use the same email address. In order to do this, open git bash on your machine.
Then use the following command to configure the no-reply email address as your commit email address.
git config --global user.email <your_noreply_email_address>
Verify that your email address has indeed changed:
git config --global user.email
git will now use the same no-reply email address as your commit email. And your personal email address will be hidden from GitHub giving you a boost in privacy.
This is pretty much it. Just wanted to share this quick tip to hide your email address on GitHub. Feel free to ask any questions in the comment section. I'll be sure to answer then as soon as I can!
Thanks for reading and happy coding! 😀