Setting your git username and email address

Single Repo

If you need to quickly set the user and email address for a single git repo, you can do this:


git config user.email john.doe@example.com
git config user.name "John Doe"

If you want to modify the .git/config file directly, you can add in this block:


[user]
name = John Doe
email = john.doe@example.com

All Repos


git config --global user.email john.doe@example.com
git config --global user.name "John Doe"

Leave a Reply

Your email address will not be published. Required fields are marked *