Configure Git User Name and Email on Windows

Set the identity Git attaches to every commit — the required first step after installing Git.

WindowscmddevelopergitLow risk
Run git config --global user.name "Your Name" and git config --global user.email "you@example.com", then check with git config --list.

01Command

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

02What it does

Git stamps every commit with this name and email, and refuses to commit until they are set, so this is the first command after installing Git for Windows. The --global flag writes to your %USERPROFILE%\.gitconfig and applies to all repositories for your Windows account; per-repo overrides can be set later by re-running the command without --global inside a repository. Use the same email as your GitHub/GitLab account for commits to be attributed correctly.

03Risk

RiskLow risk
RequirementsGit for Windows installed (winget install --id Git.Git or git-scm.com)
!Warning: The email is embedded permanently in each commit's history — avoid publishing a private email on public repositories.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • First-Time Git Setup (Pro Git book)
    Git Project · vendor-doc · 2026-09-17
    Evidence: Documents user.name and user.email as the mandatory first-run settings, set with git config --global and verified with git config --list.

Last verified: 2026-09-18 · Category: Developer

06Related solutions