Utilumo
LightDarkSystem

Updated June 29, 2026

Git config reference

git config stores settings at the global level (your machine) or local level (one repo). These are the settings most people want to set once. Add --global to apply a setting everywhere.

Identity

CommandWhat it does
git config --global user.name "Your Name"The name on your commits.
git config --global user.email "you@example.com"The email on your commits.

Sensible defaults

CommandWhat it does
git config --global init.defaultBranch mainName the first branch main in new repos.
git config --global pull.rebase trueRebase instead of merge on git pull.
git config --global core.editor "code --wait"Use VS Code for commit messages.
git config --global core.autocrlf inputNormalize line endings (macOS/Linux).
git config --global push.autoSetupRemote trueAuto-create the upstream branch on first push.

Handy aliases

CommandWhat it does
git config --global alias.st statusgit st runs git status.
git config --global alias.co checkoutgit co runs git checkout.
git config --global alias.lg "log --oneline --graph"git lg shows a compact graph log.

Inspecting config

CommandWhat it does
git config --listShow all effective settings.
git config user.emailShow one setting's value.
git config --global --editOpen the global config file in your editor.
Global vs local--global settings live in your home directory and apply everywhere. Without it, the setting applies only to the current repository and overrides the global value.

References

Questions

Where are global git settings stored?

In a file called .gitconfig in your home directory. You can edit it directly or with git config --global --edit.

How do I use a different email for one project?

Run git config user.email without --global inside that repository. The local setting overrides the global one for that project only.