Skip to content

git: Please tell me who you are

*** 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.

This is Git asking for your name and email. It needs them to write a commit. It does not know them yet.

Every Git commit records who made it. Git takes that from two settings, user.name and user.email. If they are missing and Git cannot work them out, it stops with this message. Often a second line follows, for example fatal: unable to auto-detect email address.

  • A new PC, a new Windows user or a fresh Git install. Nothing is set yet.
  • You set the name and email in one repository, and now you are in a different one.

Open Accounts in Devpit and choose the Git row. See Git and GitHub accounts.

  • The row shows the name and email Git will commit as in this folder, and where they come from.
  • Use another account here saves a name and email for this folder and every folder inside it, or for everywhere. The preview shows the exact Git lines first.

A folder rule only applies inside a Git repository. If you see this message in a new repository, the manual fix below works everywhere.

  1. Set your name and email for your whole Windows account:
Terminal window
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
  1. Check what Git now has:
Terminal window
git config --global --list
  1. Try your commit again.

To use a different identity in one repository only, run the same two commands inside that repository without --global.

If you push to GitHub over SSH and see a different error, read Permission denied (publickey).

Common questions

Do the name and email have to be real?

Git needs a name that is not empty and an email address to put in each commit. If you push to a service such as GitHub, use the email that the service links to your account so commits are shown as yours.

What is the difference between --global and a single repository?

With --global git saves the name and email for your Windows account, for every repository. Without --global git saves them only in the current repository. Git's own message says to omit --global to set the identity only in this repository.