This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-08-20. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Article version: Enterprise Server 2.18

Setting your commit email address

You can set a primary email address on GitHub Enterprise that's associated with web-based Git operations you perform such as edits and merges.

In this article

About commit email addresses

GitHub Enterprise uses your commit email address to associate commits with your GitHub Enterprise account. You can choose the email address that will be associated with the commits you push from the command line as well as web-based Git operations you make.

For web-based Git operations, you can set your commit email address on GitHub Enterprise. For commits you push from the command line, you can set your commit email address in Git.

After changing your commit email address on GitHub Enterprise, the new email address will be visible in all of your future web-based Git operations by default. Any commits you made prior to changing your commit email address are still associated with your previous email address.

To ensure that commits are attributed to you and appear in your contributions graph, use an email address that you've added to your GitHub account.

Setting your commit email address on GitHub

  1. In the upper-right corner of any page, click your profile photo, then click Settings.
    Settings icon in the user bar
  2. In the left sidebar, click Emails.
    Emails tab
  3. In "Add email address", type your email address and click Add.
    Email addition button
  4. In the "Primary email address" list, select the email address you'd like to associate with your web-based Git operations.
    Selection for primary email address

Setting your commit email address in Git

You can use the git config command to change the email address you associate with your Git commits. The new email address you set will be visible in any future commits you push to GitHub Enterprise from the command line. Any commits you made prior to changing your commit email address are still associated with your previous email address.

Setting your email address for every repository on your computer

  1. Open TerminalTerminalGit Bash.
  2. Set an email address in Git. You can use any email address.
    $ 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. Add the email address to your GitHub Enterprise account by setting your commit email address, so that your commits are attributed to you and appear in your contributions graph.

Setting your email address for a single repository

GitHub Enterprise uses the email address set in your local Git configuration to associate commits pushed from the command line with your GitHub Enterprise account.

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 you associate with your Git commits.
  3. Set an email address in Git. You can use any email address.
    $ 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. Add the email address to your GitHub Enterprise account by setting your commit email address, so that your commits are attributed to you and appear in your contributions graph.

Ask a human

Can't find what you're looking for?

Contact us