| title | Setting your commit email address | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| intro | You can set the email address that is used to author commits on {% data variables.product.github %} and on your computer. | |||||||||||||
| redirect_from |
|
|||||||||||||
| versions |
|
|||||||||||||
| shortTitle | Set commit email address | |||||||||||||
| contentType | how-tos | |||||||||||||
| category |
|
{% data reusables.files.commit-author-email-options %}
{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.emails %} {% data reusables.user-settings.add_and_verify_email %} {% data reusables.user-settings.select_primary_email %}{% ifversion fpt or ghec %} {% data reusables.user-settings.keeping_your_email_address_private %}{% endif %}
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 {% data variables.product.github %} from the command line. Any commits you made prior to changing your commit email address are still associated with your previous email address.
{% data reusables.command_line.open_the_multi_os_terminal %}
-
{% data reusables.user-settings.set_your_email_address_in_git %}
git config --global user.email "YOUR_EMAIL" -
{% data reusables.user-settings.confirm_git_email_address_correct %}
$ git config --global user.email email@example.com
-
{% data reusables.user-settings.link_email_with_your_account %}
{% data variables.product.github %} uses the email address set in your local Git configuration to associate commits pushed from the command line with your account on {% data variables.product.github %}.
You can change the email address associated with commits you make in a single repository. This will override your global Git configuration settings in this one repository, but will not affect any other repositories.
{% data reusables.command_line.open_the_multi_os_terminal %}
-
Change the current working directory to the local repository where you want to configure the email address that you associate with your Git commits.
-
{% data reusables.user-settings.set_your_email_address_in_git %}
git config user.email "YOUR_EMAIL" -
{% data reusables.user-settings.confirm_git_email_address_correct %}
$ git config user.email email@example.com
-
{% data reusables.user-settings.link_email_with_your_account %}
For reference information, see AUTOTITLE.
For more information about setting your Git username, see AUTOTITLE.