Changing commit email address in Git repo

 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 that is associated with your Git commits. git config command is used to change the user.email associated with commits. The new email address you set will be visible in any future commits you push to GitHub, changing the email associated with your Git commits using git config will only affect future commits and will not change the email used for past commits.

Changing your Git email for every repository (globally):

1) Open Git Bash or Terminal. 

2) Set an email address in Git. You can use any email address.:

$ git config --global user.email "your-name@zzz.zzz"

3) Confirm that you have set the Git username correctly:

$ git config --global user.email

your-name@zzz.zzz

4) Add the email address to your GitHub account by setting your commit email address on GitHub, so that your commits are attributed to you and appear in your contributions graph.


Changing your Git username for a single repository:

1) Open Git Bash and Terminal.

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. You can use any email address.:

$ git config user.email "your-name@zzz.zzz"

4) Confirm that you have set the Git email address correctly:

$ git config user.email

> your-name@zzz.zzz

5) Add the email address to your GitHub account by setting your commit email address on GitHub, so that your commits are attributed to you and appear in your contributions graph.

Post a Comment

If you have any questions or concerns, please let me know.

Previous Post Next Post