Configure Git Username and Email
Set the name and email Git attaches to every commit you make.
beginner3 minallUpdated August 2026
#git#configuration#beginner
Requirements
- Git installed. Follow our guide →
0/3 steps · 0%
01
Set your name
This is stored globally, so it applies to every repository unless you override it locally.
bash
$ git config --global user.name "{{YOUR_NAME}}"02
Set your email
Use the same email address associated with your GitHub account so your commits are linked to your profile.
bash
$ git config --global user.email "{{EMAIL}}"Tip
To keep your personal email private, use the noreply address GitHub generates for you under Settings → Emails.
03
Confirm the configuration
bash
$ git config --global --listExpected output
user.name={{YOUR_NAME}}
user.email={{EMAIL}}Success
Your commits will now be attributed correctly.
Troubleshooting
A local repository config is overriding your global settings.
bash
$ git config user.name$ git config user.emailRun these inside the repository. If they return different values than your global config, override them with git config user.name "…" (without --global) inside that repo.