Author identity unknown *** Please tell me who you are. — every commit records an author name and email, and Git found neither in its configuration. Set them once with git config --global user.name "Your Name" and git config --global user.email "you@example.com", then run the same git commit again.

The failed commit made nothing: your staged files are still staged. If one repository needs a different name or email, run the same two lines inside it without --global, which is what the test below did.

The error

$ git commit -m 'First note'
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 '...')

Exit code 128. The address in the last line was the Windows login and the PC's name joined into login@PCNAME.(none); it is shortened here, nothing else is changed. Windows PowerShell 5.1 printed the same block.

Why it happens

Git reads user.name and user.email from its configuration files: the system file that ships with Git, your user-level (global) file, and the repository's own .git/config. A new PC, a new Windows account, a fresh WSL distribution, a container or a CI runner has none of them set. Git then tries to build an address from the login and the machine name, sees that it is not a real address (the (none) part), and refuses to commit rather than stamp a made-up identity into the history for good.

The test reached this state by replacing the user-level file with an empty one; the Git for Windows system file on the test PC sets no identity either. Right after the error, git log answered fatal: your current branch 'main' does not have any commits yet.

The fix

On your own PC, run the two --global lines from the message with your real name and email. They write to your user-level file, .gitconfig in your home folder, and every repository uses them. The test set the values with --local instead, so it wrote to the test repository only and never touched a real user file:

$ git config --local user.name 'Maria Garcia'
$ git config --local user.email 'maria.garcia@example.test'
$ git config --show-origin --get-regexp '^user\.'
file:.git/config	user.name Maria Garcia
file:.git/config	user.email maria.garcia@example.test
$ git commit -m 'First note'
[main (root-commit) 8a6023e] First note
 1 file changed, 1 insertion(+)
 create mode 100644 notes.txt
$ git log --format='%h %an <%ae> %s'
8a6023e Maria Garcia <maria.garcia@example.test> First note

--show-origin is the command for "where does this value come from?". With --get-regexp '^user\.' it prints only the identity; git config --list --show-origin prints every setting with its file, which on the test PC began with eleven lines from C:/Program Files/Git/etc/gitconfig and ended with the two user lines from .git/config. A second test put David Chen in a user-level file and Maria Garcia in the repository: --show-origin listed all four lines and the next commit was Maria's, because the repository's value wins.

How it was reproduced

Git for Windows 2.45.2 (git version 2.45.2.windows.1) in Git Bash 5.2.26, with a cross-check in Windows PowerShell 5.1. The personal global config was replaced by an empty file through GIT_CONFIG_GLOBAL, no GIT_AUTHOR_*, GIT_COMMITTER_* or EMAIL variable was set, and the system file holds no user entries. A new repository from git init -b main, one staged file, and the first git commit gave the error. The names and addresses are fictional.

Frequently asked

How do I fix 'Author identity unknown' in Git?
Run git config --global user.name followed by your name in quotes, and git config --global user.email followed by your email in quotes. Then run your git commit again; nothing was committed by the failed attempt.
How do I use a different Git name and email for one repository?
Inside that repository run git config --local user.name and git config --local user.email with the values you want. The repository's own setting wins over the global one, and git config --show-origin --get-regexp user shows both.
Where does Git store user.name and user.email?
In one of its configuration files: the system file in the Git installation, the global .gitconfig in your home folder, or .git/config inside the repository. git config --list --show-origin prints every value with the file it came from.

More decoded errors in the Fixes category. The other settings worth making on a new Windows PC, identity included: Git for Windows settings.