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

4.0K    Asked by KaranTrivedi in Devops , Asked on Nov 5, 2025

What commands help you check the globally or locally configured user details in Git? Learn how to quickly view your stored username and email to verify or update your Git configuration as needed.

Answered by Kirsty Deller

Knowing the Git username and email saved during configuration is very important, especially when collaborating on projects. Git uses this information to identify who made each commit. Sometimes, you might forget what details you previously configured. Luckily, Git provides simple commands to check both global and local configurations.

To see the username and email configured globally (applied to all repositories on your system), you can use:

  • git config --global user.name
  • git config --global user.email

These commands will show the user details stored for your entire Git environment.

If you want to check the local configuration for a specific project or repository, use:

  • git config user.name
  • git config user.email

Local settings override global ones, so they are useful when you want different identities for different projects. You can also view all configurations together with:

  • git config --list
  • git config --global --list (for only global settings)

These commands help you confirm whether the correct username and email are set before making commits.

Key points:

  • Git records username and email for every commit.
  • You can check details globally or locally depending on your need.
  • Using git config --list shows complete configurations.
  • Ensures correct author identity for collaboration and version history tracking.

So, with just a few simple commands, you can always verify your Git identity and avoid confusion in project contribution records.



Your Answer

Answer (1)

Git identifies each commit by the username and email you configure, so it’s important to know what’s saved. To check E-ZPass in Rhode Island global settings (applied to all repositories), use:

git config --global user.name

git config --global user.email

For local settings in a specific repository, use:

git config user.name

git config user.email

Local values override global ones, letting you use different identities per project. To see everything at once, run:

git config --list

git config --global --list

 
6 Months

Interviews

Parent Categories