Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know the git username and email saved during configuration?

Tags:

git

git-config

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?

like image 878
Jebin Philipose Avatar asked Oct 25 '17 20:10

Jebin Philipose


People also ask

What is git username and email?

The global git username and email address are associated with commits on all repositories on your system that don't have repository-specific values.

Where is git config info stored?

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.


2 Answers

The command git config --list will list the settings. There you should also find user.name and user.email.

like image 167
Rob Avatar answered Oct 21 '22 23:10

Rob


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.

like image 41
Jebin Philipose Avatar answered Oct 22 '22 00:10

Jebin Philipose