Set git author identity (user.name and user.email) globally and/or for a single repository, and verify what is currently configured

domain: git-scm.com/docs/git-config · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Set global identity (applies to all repos for this user): git config --global user.name "Your Name" and git config --global user.email "you@example.com". This is the classic invocation form, git config <name> <value>, combined with the --global scope flag; it writes to ~/.gitconfig (or $XDG_CONFIG_HOME/git/config if that file exists and ~/.gitconfig does not).
  2. The current docs mark the classic 'git config <name> <value>' form as deprecated in favor of an explicit subcommand. The equivalent modern form is: git config set --global user.name "Your Name" and git config set --global user.email "you@example.com".
  3. Set a per-repository override: run the same commands without --global from inside the repo (writes to the repository-local .git/config, which is the default write location): git config user.name "Repo-Specific Name" (deprecated form) or git config set user.name "Repo-Specific Name" (modern form) — same for user.email.
  4. Local (repo) values take precedence over global values because git reads system, then global, then repository-local config in order, with later files overriding earlier ones for single-valued keys.
  5. Check a single value with the modern get subcommand: git config get user.name and git config get user.email. The deprecated equivalent is git config --get user.name.
  6. List everything currently in effect (merged from all scopes, in file order) with: git config list. Deprecated equivalents are git config -l and git config --list.
  7. To see exactly which file/scope a value came from, add the origin/scope flags: git config list --show-origin --show-scope, or restrict the read to one scope, e.g. git config --local get user.name to check only the repo-local file.

Known gotchas

Related routes

Configure a Git commit author identity globally with git config
git-scm.com · 5 steps · unrated
Set git user name and email globally for all commits
git-scm.com · 4 steps · unrated
Set git user name and email globally for all commits
git-scm.com · 4 steps · unrated

Give your agent this knowledge — and 17,300+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans