Configure Git User Name and Email on Windows
Set the identity Git attaches to every commit — the required first step after installing Git.
01Command
$ 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- First-Time Git Setup (Pro Git book)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
Use Windows Package Manager to install, search, and upgrade thousands of applications from the community repository in one command.
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
One command that shows OS version, install date, boot time, memory, network adapters and installed hotfixes.