Progress:
TIER 3 · MODULE 43· Expert

git var

Editor, pager, default branch — what Git thinks they are.

🎯 What & why

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.

🧠 Mental model

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.

🛠️ Synopsis

git var (-l | --list)
git var <variable>

🎚️ Switches & options

FlagWhat it does
-l, --listPrint every known variable as KEY=value, like 'env' output.
GIT_AUTHOR_IDENTThe author identity Git would use right now (name, email, time).
GIT_COMMITTER_IDENTThe committer identity Git would use right now.
GIT_EDITORThe editor Git will launch (commit messages, interactive rebase, etc.).
GIT_PAGERThe pager command Git will pipe long output into.
GIT_DEFAULT_BRANCHThe branch name 'git init' would create (e.g. 'main').
GIT_OBJECT_DIRECTORYPath to .git/objects (or override).
GIT_INDEX_FILEPath to the index file in use.

💡 Use cases

🧪 Examples

Show every known variable
git var -l
Which editor will git use?
git var GIT_EDITOR
Author identity right now
git var GIT_AUTHOR_IDENT
Default branch for new repos
git var GIT_DEFAULT_BRANCH

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.