This guide will explain:
- How to View the Git Global Email and Username Saved During Configuration?
- How to View the Git Local Email and Username Saved During Configuration?
- How to View the List of All Git Emails and Usernames Saved During Configuration?
Let’s check out the above-stated methods one by one!
How to View the Git Global Email and Username Saved During Configuration?
The saved global Git username and email address are associated with Git commit on all repositories on the developer system.
Follow the below-listed steps to know the globally saved username and email address.
Step 1: View Git Global Username
To view the globally saved Git username, run the “git config” command with the “–global” option and “user.name”:
As you can see, it will display the globally saved username:
Step 2: View Git Global Email
Execute the “git config” command with the “–global” option and “user.email” to know the globally saved Git user email address:
The globally saved user email will be displayed after executing the above-listed command:
How to View the Git Local Email and Username Saved During Configuration?
The locally saved username and email address are accessible for specific repositories. Check out the following steps to view the saved username and email address.
Step 1: Display Git Local Username
To display the locally saved Git username for users, execute the “git config” command with “user.name”:
Step 2: Display Git Local Email
Run the “git config” command to view the saved local user email:
How to View the List of All Git Emails and Usernames Saved During Configuration?
If you want to view the list of all Git usernames and emails saved during configuration, the following command can be used:
As you see, the list of all globally and locally added usernames and emails would display:
That’s all! We have provided the procedure to view the globally and locally saved usernames and user emails during configuration.
Conclusion
To view the globally saved username and user email during configuration, the “$ git config –global user.name” and “$ git config –global user.email” commands are used. On the other hand, if you want to show the locally saved username and user email during the configuration, the “$ git config user.name” and “$ git config user.email” commands are used. The “$ git config –list” command is used to view the list of all Git usernames and emails saved dusting configuration. This guide described the several ways to show the Git username and email saved during configuration.