Anonymous Guy
Anonymous Guy

Reputation: 307

Is it possible to show an email on GitHub profile while keeping other emails private?

Let's say you have two emails A, and B.

Your primary email is A, and you have kept your emails private. So you use the noreply GitHub email for commits in git and online, and it blocks command line pushes which expose my email.

I would like to continue that, but I also want to show email B on my profile (that is, in the email field, not in the description). But I do not want to inadvertantly leak A.

Is this possible?

Upvotes: 10

Views: 5780

Answers (2)

szx
szx

Reputation: 6926

It's possible only if you check the checkbox "Keep my email addresses private", in which case all web-based Git operations will use the generated @users.noreply.github.com email.

Downside: You can't use your public email in your web commits either.

If you don't check this option, GitHub will leak your "private" primary email in a few cases that I know of (from my experience with this "feature"):

  • When you commit something via the web UI and forget to select your public email in the dropdown menu - the primary email sometimes is selected by default, even if you've been using your public email in all of the commits prior to that
  • When maintainers merge your pull requests via the squash strategy - this one is not obvious, I've had this happen to me a couple of times

Upvotes: -2

bk2204
bk2204

Reputation: 76489

Yes, this is possible to do. You just add the new email, verify it, and then choose it as the one you want to display on your profile. You can continue to use a different email, including the GitHub-created noreply one, in your commits.

Upvotes: -2

Related Questions