How to Check Username and Email Configuration in Git

John Wachira Feb 02, 2024
How to Check Username and Email Configuration in Git

This article illustrated how we could check our git username and password. We will also discuss the process of configuring these credentials.

Check Username and Email Configuration in Git

Assuming we have already set a username and email, how do we check them? To check the username, run the git config command, and the command will output the configured username.

Command:

$ git config user.name

To check the email, run the command below.

Command:

$ git config user.email

Let’s have the following example. We will run the commands above to check the configured credentials in our Git repository.

check the configured credentials in our Git repository

The following commands will allow us to configure or change the existing username and email in Git.

To configure the username.

Command:

$ git config --global user.name "Your Name"

To configure the email.

Command:

$ git config --global user.email "Email"

Let’s have another example where we’ll attempt to change our username and email shown in the image above. The following commands should change our details.

Command:

$ git config --global user.name "John. W"
$ git config --global user.email "wachirajohnie11@gmail.com"

Output:

change username and email in Git

Author: John Wachira
John Wachira avatar John Wachira avatar

John is a Git and PowerShell geek. He uses his expertise in the version control system to help businesses manage their source code. According to him, Shell scripting is the number one choice for automating the management of systems.

LinkedIn

Related Article - Git Config