How to fix fatal: please tell me who you are - run git config --global user.email / user.name in Git

GitBEGINNERLOWUpdated Dec 6, 2025ยท 373 views

This error occurs when Git cannot identify you as a user because the required user.name and user.email configuration values are not set. Git needs this identity information to record who made each commit. The fix is straightforward: configure your name and email using git config commands.

Quick fix

Fixes fatal: please tell me who you are - run git config --global user.email / user.name

git config --global user.name "Your Name"
git config --global user.email "you@example.com"
  1. Configure your Git identity globally
  2. Set identity for a single repository only
  3. Retry your commit after configuring
  4. View your complete Git configuration
git โ€” error
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
fatal: please tell me who you are - run git config --global user.email / user.name

What this error means

The "fatal: please tell me who you are" error is Git's way of saying it doesn't know your identity. Every Git commit must have an author with a name and email address, and Git stores this information in your commits permanently. When you try to make a commit without these settings configured, Git cannot create the author line (which looks like "Author: John Doe <john@example.com>") and refuses to proceed. This is one of the first errors new Git users encounter because Git requires this one-time setup before you can create any commits. The error message helpfully tells you exactly what commands to run to fix it. Common scenarios where this error appears: - First time using Git on a new computer or user account - Running Git inside a Docker container or CI/CD pipeline - Using Git on a shared server or cloud development environment - After a fresh operating system installation

Typical symptoms

  • Git commit fails with 'fatal: please tell me who you are'
  • Error message suggests running git config --global user.email and user.name
  • Cannot make your first commit in a repository
  • CI/CD pipeline fails at the git commit step
  • Docker builds fail when trying to create commits
  • IDE or GUI Git client shows identity configuration error
  • Error appears immediately after git commit command

Common causes

  1. Git user.name and user.email are not configured (most common)
  2. Fresh Git installation with no initial configuration
  3. Running Git as a different user (e.g., root or service account) without config
  4. Docker container or CI environment missing Git identity setup
  5. Cloud IDE or remote development environment with unconfigured Git
  6. Switching to a new computer or operating system
  7. Using Git for the first time on this machine

How to fix "fatal: please tell me who you are - run git config --global user.email / user.name"

1Configure your Git identity globally

Run these two commands to set your name and email for all repositories on your computer:

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

Replace "Your Name" with your actual name and "you@example.com" with your email address. These values are stored in ~/.gitconfig and apply to all repositories on your system.

Important: Use quotes around your name, especially if it contains spaces. The email doesn't require quotes but it's good practice to include them.

After setting these, verify the configuration:

bash
git config --global user.name
git config --global user.email
2Set identity for a single repository only

If you need different identities for different projects (e.g., work vs personal), omit the --global flag to configure just the current repository:

bash
cd /path/to/your/repo
git config user.name "Your Name"
git config user.email "you@example.com"

This creates entries in .git/config within that specific repository. Local settings override global settings, so you can have a default identity globally and override it per-project as needed.

Verify the local setting:

bash
git config user.name
git config user.email
3Retry your commit after configuring

Once you've set your identity, retry the commit that failed:

bash
git commit -m "Your commit message"

The commit should now succeed. You can verify it worked by checking the log:

bash
git log -1 --format="%an <%ae>"

This shows the author name and email of the most recent commit.

4View your complete Git configuration

To see all your Git settings and where they come from, use:

bash
git config --list --show-origin

This displays each configuration value along with the file it's defined in. You'll see entries like:

bash
file:/home/user/.gitconfig    user.name=Your Name
file:/home/user/.gitconfig    user.email=you@example.com

To check only the user settings:

bash
git config --global --get user.name
git config --global --get user.email
5Configure Git in Docker containers

When using Git inside Docker, add the configuration to your Dockerfile:

dockerfile
RUN git config --global user.name "Docker Build" && \
    git config --global user.email "docker@example.com"

Or pass it at runtime:

bash
docker run -e GIT_AUTHOR_NAME="Your Name" \
           -e GIT_AUTHOR_EMAIL="you@example.com" \
           -e GIT_COMMITTER_NAME="Your Name" \
           -e GIT_COMMITTER_EMAIL="you@example.com" \
           your-image

These environment variables override the git config settings.

6Configure Git in CI/CD pipelines

For automated pipelines that need to make commits, add Git configuration early in your workflow:

GitHub Actions:

yaml
- name: Configure Git
  run: |
    git config --global user.name "github-actions[bot]"
    git config --global user.email "github-actions[bot]@users.noreply.github.com"

GitLab CI:

yaml
before_script:
  - git config --global user.name "GitLab CI"
  - git config --global user.email "gitlab-ci@example.com"

Jenkins (Groovy):

groovy
sh 'git config user.name "Jenkins Build"'
sh 'git config user.email "jenkins@example.com"'

Azure DevOps:

yaml
- script: |
    git config --global user.name "Azure DevOps"
    git config --global user.email "azuredevops@example.com"
  displayName: Configure Git

Advanced notes

Common Typo: user.mail vs user.email

A frequent mistake is accidentally typing user.mail instead of user.email (missing the 'e'). Git won't warn you about this typo - it will simply store it as a custom config key. If you suspect this might be the issue:

bash
git config --global --get user.mail    # Check for typo
git config --global --unset user.mail  # Remove if found
git config --global user.email "you@example.com"  # Set correctly

Understanding Author vs Committer

Git tracks two identities for each commit:
- Author: The person who originally wrote the code
- Committer: The person who created the commit (may differ when cherry-picking, rebasing, or applying patches)

Both use the same user.name and user.email by default, but can be overridden separately with environment variables:
- GIT_AUTHOR_NAME / GIT_AUTHOR_EMAIL
- GIT_COMMITTER_NAME / GIT_COMMITTER_EMAIL

Configuration Precedence

Git configuration follows this hierarchy (later overrides earlier):
1. System config: /etc/gitconfig (all users)
2. Global config: ~/.gitconfig or ~/.config/git/config (current user)
3. Local config: .git/config (current repository)
4. Environment variables: GIT_AUTHOR_*, GIT_COMMITTER_*

Using Conditional Includes for Multiple Identities

If you work on projects requiring different identities (personal vs work), use conditional includes in ~/.gitconfig:

ini
[user]
    name = Personal Name
    email = personal@gmail.com

[includeIf "gitdir:~/work/"]
    path = ~/.gitconfig-work

Then create ~/.gitconfig-work:

ini
[user]
    name = Work Name
    email = work@company.com

Any repository under ~/work/ will automatically use your work identity.

Windows and WSL Considerations

On Windows with WSL (Windows Subsystem for Linux), Git has separate configurations:
- Windows Git: Config in C:\Users\YourName\.gitconfig
- WSL Git: Config in /home/yourname/.gitconfig

You'll need to configure both if you use Git from both environments.

Frequently asked questions

What does "fatal: please tell me who you are - run git config --global user.email" mean?
The "fatal: please tell me who you are" error is Git's way of saying it doesn't know your identity. Every Git commit must have an author with a name and email address, and Git stores this information in your commits permanently. com>") and refuses to proceed.
How do I fix "fatal: please tell me who you are - run git config --global user.email"?
This error occurs when Git cannot identify you as a user because the required user.name and user.email configuration values are not set. Git needs this identity information to record who made each commit. The fix is straightforward: configure your name and email using git config commands.
What causes "fatal: please tell me who you are - run git config --global user.email"?
Git user.name and user.email are not configured (most common) Fresh Git installation with no initial configuration Running Git as a different user (e.g., root or service account) without config
Is the "fatal: please tell me who you are - run git config --global user.email" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading