Git will not make a commit until it knows who you are. To fix “Author identity unknown, *** Please tell me who you are”, set your name and email once:
git config --global user.name "Your Name" git config --global user.email "you@example.com"
Change the name and email to yours, then run the commit again. --global saves them for every repository on your account. The full error looks like this:
Author identity unknown *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got 'you@PC.(none)')

Check What Is Set
# the global values git config --global user.name git config --global user.email # which value wins here, and which file it came from git config --show-origin --get-regexp "^user\."
--show-origin is the useful one when the wrong name is showing up: it prints the config file each value comes from.
One Repository With a Different Email
Leave out --global and run it inside the repository. The value is saved in that repository’s .git/config and beats the global one there. That is how you keep a work email on work repositories and a personal one everywhere else:
cd C:\path\to\work-repo git config user.email "me@work.example"
Which Email GitHub Expects
Use an email that is added to your GitHub account (Settings, then Emails). Commits made with an email GitHub does not know are not linked to your profile or counted on your contributions graph. If you do not want your real address in public commits, use the no-reply address from the same page, which looks like 12345+username@users.noreply.github.com. Copy the exact one from your own Emails page. GitHub also has a setting to block pushes that expose a private email, so if a push is refused after this, check that setting first.
I Already Committed With the Wrong Name
Fix the config first, then rewrite the last commit’s author. Only do this on a commit that has not been pushed:
git commit --amend --reset-author --no-edit
Why It Happens
Every commit records an author name and email. Git does not guess them, and on a fresh install or a new Windows account nothing is set yet, so the first commit stops with this message. It is a one-time setup, not a fault with the repository. The email Git printed in brackets at the end is only a guess from your computer name, which is why it ends in (none).
Common Questions
Does this change commits I already made?
No. It only affects new commits. Old ones keep the author they were made with.
Do the name and email have to be real?
Git accepts anything, but GitHub only links commits to your account if the email matches one on it.
Does this log me in to GitHub?
No. The name and email are just text stamped on commits. Signing in or pushing is separate, see the SSH keys post for that.
Related
If SQL Server is part of your day job, my current work lives over at sqldba.blog: production DBA scripts, an error library and the SSMS guide.
Leave a Reply