Published on

GitHub Desktop "Keep my email address private" Error

Authors
  • avatar
    Name
    hwahyeon
    Twitter

Error

Cannot push these commits as they contain an email address marked as private on GitHub. To push anyway, visit https://github.com/settings/emails, uncheck "Keep my email address private", then switch back to GitHub Desktop to push your commits. You can then enable the setting again.


When the "Keep my email address private" setting is enabled, a virtual email address (username@users.noreply.github.com) automatically generated by your GitHub account can be used for commits. GitHub Desktop typically uses the email set in your local Git configuration, but if this local Git email does not match your GitHub account's private email setting, it may result in a push error.

As the error message suggests, you can uncheck "Keep my email address private" setting to resolve this issue. However, if you want to continue using the private email, here are some solutions:

  1. Set your local Git email to the private email:
git config --global user.email "username@users.noreply.github.com"

※ If you want to apply this setting only to a specific project, execute the above command without the --global option in the desired project directory.

  1. Change GitHub Desktop settings:

Go to FileOptionsGitEmail in GitHub Desktop, and set the email address to username@users.noreply.github.com. This way, you can use the private email for commits and pushes.