While configuring git
I ran these two commands:
git config --global user.name "My Name" git config --global user.email "[email protected]"
However, I doubt whether I made a typo or not. So, is there any command to know the name and email which git
saved during configuration? Obviously, I can know that using the git log
command by looking at the commit history. But for that I have to make commits, right? Can I know that with the help of command line?
The global git username and email address are associated with commits on all repositories on your system that don't have repository-specific values.
The file at %USERPROFILE%\. gitconfig is considered the master global file where you make all your changes. Run this command from within a Windows command shell to create a symbolic link for the system and global file.
The command git config --list
will list the settings. There you should also find user.name
and user.email
.
Considering what @Robert said, I tried to play around with the config
command and it seems that there is a direct way to know both the name and email.
To know the username, type:
git config user.name
To know the email, type:
git config user.email
These two output just the name and email respectively and one doesn't need to look through the whole list. Comes in handy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With