Editor, pager, default branch — what Git thinks they are.
git var prints the values of Git's internal variables - editor, pager, default branch, identities. Tells you what Git actually thinks they are after all the config layering.
Resolves config + env + compiled-in defaults for a small set of named variables and prints them. Read-only window into Git's effective settings, not arbitrary config keys.
git var (-l | --list)
git var <variable>| Flag | What it does |
|---|---|
-l, --list | Print every known variable as KEY=value, like 'env' output. |
GIT_AUTHOR_IDENT | The author identity Git would use right now (name, email, time). |
GIT_COMMITTER_IDENT | The committer identity Git would use right now. |
GIT_EDITOR | The editor Git will launch (commit messages, interactive rebase, etc.). |
GIT_PAGER | The pager command Git will pipe long output into. |
GIT_DEFAULT_BRANCH | The branch name 'git init' would create (e.g. 'main'). |
GIT_OBJECT_DIRECTORY | Path to .git/objects (or override). |
GIT_INDEX_FILE | Path to the index file in use. |
git var -lgit var GIT_EDITORgit var GIT_AUTHOR_IDENTgit var GIT_DEFAULT_BRANCHHit each option, then Check answers. Score is recorded; Next is always open.