Setting your commit 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 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 Terminal.
  2. Set an email address in Git. You can use your GitHub-provided no-reply email address or any email address.
$ git config --global user.email "[email protected]"
  1. Confirm that you have set the email address correctly in Git:
$ git config --global user.email
[email protected]
  1. Add the email address to your GitHub 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 uses the email address set in your local Git configuration to associate commits pushed from the command line with your GitHub 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 Terminal.
  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 your GitHub-provided no-reply email address or any email address.
$ git config user.email "[email protected]"
  1. Confirm that you have set the email address correctly in Git:
$ git config user.email
[email protected]
  1. Add the email address to your GitHub account by setting your commit email address, so that your commits are attributed to you and appear in your contributions graph.

Refer: https://help.github.com/en/articles/setting-your-commit-email-address#setting-your-commit-email-address-in-git

1 Like