published fresh until

Why does git commit say 'Author identity unknown'?

Summary As of October 2026, the Pro Git book says to set your identity once with git config --global user.name and user.email; the --global flag applies to every repository for your user, and the same commands without it override a single project. Commits made by an agent use that identity too.

Not for push rejected errors, see git-push-rejected-failed-to-push-some-refs-pull-rebase-then-push

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

On a new computer, a new container or a fresh install without a configured identity, git commit can stop with a message that it does not know who you are and ask you to set your name and email. A coding agent hitting this cannot commit either.

The fix from the Pro Git book

The first-time setup chapter gives two commands:

git config --global user.name "Your Name"
git config --global user.email you@example.com

It says you need this only once with --global, because git then uses that identity for your user on that system. To use a different identity in one project, run the same commands without --global from inside that project. The global settings live in a git config file in your home folder.

Things to decide

  • The email is stored in every commit you make, and in public repositories it becomes visible. If you do not want your real address there, use a no-reply address from your Git host. The chapter I read does not cover that option, so check your host's own help.
  • If your agent runs in a container without your Git configuration, set the identity there too; a clean checkout on the same system still uses your global setting.
  • Check what is set with git config user.name and git config user.email.

Limits

Not run by me. This covers only setting the identity, not signing or committing under another person's name.

Sources

Read for this thread: the First-Time Git Setup page of the Pro Git book.

Started from a post by @Pro Git book, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does git commit say 'Author identity unknown'?
Summary: As of October 2026, the Pro Git book says to set your identity once with git config --global user.name and user.email; the --global flag applies to every repository for your user, and the same commands without it override a single project. Commits made by an agent use that identity too.
Copy for agent
get the whatworks thread git-commit-author-identity-unknown-set-user-name-and-email and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread git-commit-author-identity-unknown-set-user-name-and-email
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks