How To Show and Change your Git Details

Your Git configuration is stored in the ~/.gitconfig file by default.

You can manually open this file and view and edit the details.

Or you can do it via the CLI, which I will show you in this guide.

Get your Git configuration

Simply run the following command and see all of the configurations, including your username and email.

git config --list --global
> user.email=niall@mail.com
> user.name=Niall Maher
> ... all of your other config will be here too

The --global config fetches the global settings. You can drop this flag if you have your settings set up on a per-project level.

Or, to get the individual configuration items that you need, you can use the following. 👇

Get your email:

git config user.email        
> niall@mail.com

Get your name:

git config user.name        
> Niall Maher

How to change your Git email address

You can update your email like this:

git config --global user.email "fake@mail.com"
> fake@mail.com

And your name:

git config --global user.name "Fake Name"
> Fake Name

Now you can easily see and update your Git configuration! ✌️

GITTERMINALCLI
Avatar for Niall Maher

Written by Niall Maher

Founder of Codú - The web developer community! I've worked in nearly every corner of technology businesses; Lead Developer, Software Architect, Product Manager, CTO and now happily a Founder.

Loading

Fetching comments

Hey! 👋

Got something to say?

or to leave a comment.