GitHub Enterprise uses the email address you set in your local Git configuration to associate commits with your GitHub Enterprise account.

You can change the email address that is associated with your Git commits using the git config command. The new email address you set will be visible in any future commits you push to GitHub Enterprise from the command line. If you'd like to keep your email address private, you can use username@users.noreply.github.com instead of your personal email address.

Warning: If you use your username@users.noreply.github.com address to make commits and then change your username, those commits will no longer be associated with your GitHub Enterprise account. For more information, see "What happens when I change my username?"

Changing the email address associated with your Git commits using git config will only affect future commits and will not change the email address used for past commits.

To ensure that your commits can be attributed to you and displayed in your contributions graph, use an email address that has been added to your GitHub Enterprise account, or your username@users.noreply.github.com address.

Setting your email address for every repository on your computer

  1. Open TerminalTerminalGit Bash.

  2. Set an email address in Git. To keep your email address private, you can use the address username@users.noreply.github.com, replacing username with your GitHub Enterprise username.

    $ git config --global user.email "email@example.com"
    
  3. Confirm that you have set the email address correctly in Git:

    $ git config --global user.email
    email@example.com
    
  4. Link the email address to your GitHub Enterprise account, so that your commits can be attributed to you and displayed in your contributions graph.

Setting your email address for a single repository

You can change the email address associated with commits you make in a single repository. This will override your global Git config settings in this one repository, but will not affect any other repositories.

  1. Open TerminalTerminalGit Bash.

  2. Change the current working directory to the local repository where you want to configure the email address that is associated with your Git commits.

  3. Set an email address in Git. To keep your email address private, you can use the address username@users.noreply.github.com, replacing username with your GitHub Enterprise username.

    $ git config user.email "email@example.com"
    
  4. Confirm that you have set the email address correctly in Git:

    $ git config user.email
    email@example.com
    
  5. Link the email address to your GitHub Enterprise account, so that your commits can be attributed to you and displayed in your contributions graph.

Further reading