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 > firstname.lastname@example.org > user.name=Niall Maher > ... all of your other config will be here too
--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 > email@example.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 "firstname.lastname@example.org" > email@example.com
And your name:
git config --global user.name "Fake Name" > Fake Name
Now you can easily see and update your Git configuration! ✌️