How to configure Git user name and email?
Sebastian Wright
So this is going to sound pretty foolish, but I'm just trying to be safe. In the link below, it says that the terminal will require us to enter our name and email. Do we enter in our actual name (if so, our full name/with or without spaces/what formatting?) and our actual email, or simply continue to enter in the scripts:
git config --get user.name
git config --get user.email as the site tells us?
Here is the link to the site I am referring to:
3 Answers
This answer is an addendum to the other answers, and although it answers the commands question like the other answers, it has additional information added which was not touched on in other answers.
As stated in other answers, the full commands to use are in the following format:
git config --global user.email ""
git config --global user.name "Bob Smith"As to what to put here specifically, that's up to you. Keep in mind, however, where the git project resides. If the Git project resides on GitHub, BitBucket, or a private GitLab instance, then in order for your commits there to tie to your username, your user.email configuration option should match an email address of which you have registered on those sites.
If the repository owner wants you to be using a specific name and address for yourself, then you may also wish to set this here as well.
Note that this affects every single git repository you use. Most of the time people and projects don't care, but sometimes they do. Make sure what you set here is 'OK' and valid for all the git projects you work on.
0You enter whatever your want. If you don't want to enter your actual full name, you can use a pseudonym and a fake email.
Those information are useful, for example, if you intent to contribute to project using git. Configuring your full name and email is a way to show in a project who you are and what you have contributed to the project.
The full command are the following :
git config --global user.name "Jacques Chirac"
git config --global user.email ""(You can put spaces and whatever formatting you want/need)
3The correct formating is like this :
git config --get user.email ""
git config --get user.name "John Doe" 1