How to Configure Git Username and Email Address
Git is a distributed version control system that’s widely used by most software teams today. Git allows you to set a global and per-project username and email address. In this article we are going to see how to configure git username and email address.
Set the username/email gloablly
The global git username and email address are associated with commits on all repositories on your system that don’t have repository-specific values. To configure the global username and email address, run the following commands:
1
2
3
git config --global user.name "John Doe"
git config --global user.email "[email protected]"
1 | git config --global user.name "John Doe" |
Verify the results by running the following command:
1 | git config --global user.name |
Set the username/email per repository
You can also set the username and email address on a per-repository basis. To do this, navigate to the root directory of the repository and run the following commands:
1
2
3
git config user.name "John Doe"
git config user.email "[email protected]"
1 | git config user.name "John Doe" |
Verify the results by running the following command:
1 | git config --get user.name |
Conclusion
In this tutorial, we learned how to how to configure Git username and email address. You can find the all the related commands for this tutorial from here. If you have any issue regarding this tutorial, mention your issue in the comment section or reach me through my E-mail.
Happy Coding
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Comments
GitalkDisqus