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.
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 <[email protected]>") 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
Run these two commands to set your name and email for all repositories on your computer:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"Replace "Your Name" with your actual name and "[email protected]" 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:
git config --global user.name
git config --global user.emailIf you need different identities for different projects (e.g., work vs personal), omit the --global flag to configure just the current repository:
cd /path/to/your/repo
git config user.name "Your Name"
git config user.email "[email protected]"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:
git config user.name
git config user.emailOnce you've set your identity, retry the commit that failed:
git commit -m "Your commit message"The commit should now succeed. You can verify it worked by checking the log:
git log -1 --format="%an <%ae>"This shows the author name and email of the most recent commit.
To see all your Git settings and where they come from, use:
git config --list --show-originThis displays each configuration value along with the file it's defined in. You'll see entries like:
file:/home/user/.gitconfig user.name=Your Name
file:/home/user/.gitconfig [email protected]To check only the user settings:
git config --global --get user.name
git config --global --get user.emailWhen using Git inside Docker, add the configuration to your Dockerfile:
RUN git config --global user.name "Docker Build" && \
git config --global user.email "[email protected]"Or pass it at runtime:
docker run -e GIT_AUTHOR_NAME="Your Name" \
-e GIT_AUTHOR_EMAIL="[email protected]" \
-e GIT_COMMITTER_NAME="Your Name" \
-e GIT_COMMITTER_EMAIL="[email protected]" \
your-imageThese environment variables override the git config settings.
For automated pipelines that need to make commits, add Git configuration early in your workflow:
GitHub Actions:
- 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:
before_script:
- git config --global user.name "GitLab CI"
- git config --global user.email "[email protected]"Jenkins (Groovy):
sh 'git config user.name "Jenkins Build"'
sh 'git config user.email "[email protected]"'Azure DevOps:
- script: |
git config --global user.name "Azure DevOps"
git config --global user.email "[email protected]"
displayName: Configure GitCommon 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:
git config --global --get user.mail # Check for typo
git config --global --unset user.mail # Remove if found
git config --global user.email "[email protected]" # Set correctlyUnderstanding 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:
[user]
name = Personal Name
email = [email protected]
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig-workThen create ~/.gitconfig-work:
[user]
name = Work Name
email = [email protected]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.
warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server