How to set Git username and email address
📅June 14, 2021
🗁Git
Today we will show you how to set Git username and email address at global level and local level. It will be used when you commit your code in repository.
You may also check the following article.
Git Installation on Windows – A Step-by-Step Guide
Configure username and email address in Git
1. Configure at global level
If you don’t want to set the username and email for each repository then you should set the username and email at global level. Following command will be used to do it.
git config --global user.name "<USER NAME>"
git config --global user.email "<USER EMAIL ADDRESS>"
2. Configure at local level
To set the repository specific configuration then you can use the following command in the project directory.
git config user.name "<USER NAME>"
git config user.email "<USER EMAIL ADDRESS>"
3. Check the configuration list
In order to check the git configuration, you should use the below command.
To check local configuration
git config --list
To check global configuration
git config --global --list
That’s it for today. Happy Coding!