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
Open TerminalTerminalGit Bash.
-
Set an email address in Git. To keep your email address private, you can use the address
username@users.noreply.github.com
, replacingusername
with your GitHub Enterprise username.$ git config --global user.email "email@example.com"
-
Confirm that you have set the email address correctly in Git:
$ git config --global user.email email@example.com
-
Link the email address to your GitHub Enterprise account, so that your commits can be attributed to you and displayed in your contributions graph.
- If you configured a personal email address, add the email to your GitHub Enterprise account.
- If you configured
username@users.noreply.github.com
, tell GitHub Enterprise to keep your email address private.
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.
Open TerminalTerminalGit Bash.
Change the current working directory to the local repository where you want to configure the email address that is associated with your Git commits.
-
Set an email address in Git. To keep your email address private, you can use the address
username@users.noreply.github.com
, replacingusername
with your GitHub Enterprise username.$ git config user.email "email@example.com"
-
Confirm that you have set the email address correctly in Git:
$ git config user.email email@example.com
-
Link the email address to your GitHub Enterprise account, so that your commits can be attributed to you and displayed in your contributions graph.
- If you configured a personal email address, add the email to your GitHub Enterprise account.
- If you configured
username@users.noreply.github.com
, tell GitHub Enterprise to keep your email address private.