git config
The command that reads and writes Git settings, which live in plain text config files.
In more detail
Settings are written as section.key, for example user.name or core.editor. git config user.name prints the current value, and git config --global user.name 'Ada Lovelace' sets it. Git reads three files in turn and the last one that sets a key wins, so a repository can override your personal defaults.
Examples
git config --global --listgit config --get-regexp '^alias'Related terms
- config scope — Which of Git's config files a setting lives in: system for every user, global for you, or local for one repository.
- --show-origin — Flags for git config that print which file, or which scope, a setting's value came from.
- user.name and user.email — The two settings that give the name and email Git writes as the author and committer of every commit you make.
- core.editor — The setting that names the text editor Git opens for commit messages and other text you need to write.
Taught in
- Installing Git, And Telling It Who You Are — Advanced Git Internals & Distributed Workflows
- What A Remote Actually Is — Advanced Git Internals & Distributed Workflows