Git: Please Tell Me Who You Are
Your very first commit fails with 'Please tell me who you are.' Git just needs a name and email to stamp on commits — you haven't set them yet. Two commands and you're done, for good.
You try to make your first commit and Git stops you cold:
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
fatal: unable to auto-detect email address
Nothing is broken. Every commit records who made it — a name and an email — and Git simply doesn't know yours yet. It's helpfully printing the exact commands to fix it. This is a one-time setup on a fresh machine.
Why Git needs this
A commit is a permanent record with an author attached. Git won't invent one, and it won't let you commit anonymously, so until you tell it who you are it refuses to create the commit. That author info is also what shows up next to your work on GitHub or GitLab.
Step 1: Set your identity globally
Run the two commands from the error message — they set the name and email for all your repos on this machine:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Now retry your commit; it goes through.
Step 2 (optional): A different identity for one repo
If a particular project needs a different email (work vs personal), set it without --global from inside that repo — it overrides the global value there only:
cd my-work-project
git config user.email "[email protected]" # this repo only
--globalsets your default everywhere; the same command without it sets an override for the current repo. Per-repo always wins over global.
Check what's set
git config --global --list # your machine-wide defaults
git config user.email # what THIS repo will actually use
The checklist
- The error means your commit author isn't configured — not a bug.
git config --global user.name+user.email(one-time per machine).- Need a different email for one project? Set it without
--globalinside that repo. - Verify with
git config --list.
Frequently Asked Questions
How do I fix "Please tell me who you are" in Git?
Set your commit identity once with git config --global user.name "Your Name" and git config --global user.email "[email protected]", then retry the commit. It's a one-time setup per machine.
Do I have to use my real email for Git?
It only stamps your commits — but if you push to GitHub, use the email tied to your account (or GitHub's @users.noreply.github.com address) so your commits link to your profile.
Why does Git keep asking who I am on a new computer?
The identity is stored per-machine in your global config, so each new computer needs it set once. Run the two git config --global commands there, or set a different email per repo without --global.
Stop reading, start building
This pairs with a hands-on BytExplorer course — do it on your own machine and actually keep the skill.