GIT-VAR(1)
π GIT-VAR(1) β the git-var glow-up β¨
Okay bestie, gather round, because this one is literally the manual page for git-var β part of the Git Manual, no big deal. It's giving "let me show you a Git logical variable" and honestly? It ate. π
πΈ NAME πΈ
git-var β show a Git logical variable. That's it. That's the whole vibe. π
β¨ SYNOPSIS β¨
git var (-l | <variable>)
Periodt. You either ask for the list with -l, or you ask for one specific <variable>. No in-between, no cap. π«Ά
π« DESCRIPTION π«
So basically, git var prints out a Git logical variable for you. And if that variable has no value? It exits with code 1. Not dramatic, just honest. The way it just dips. π
π OPTIONS π
-lβ okay so this one displays the logical variables. But wait, there's more: it also lists all the variables of the Git configuration file.git/configas well. However β and this is the important part β that configuration variables listing functionality is deprecated in favor ofgit config list. So like, yeah, it works, but it's giving "old news" and you should probably use the new thing. Slay for backwards compatibility though. π
π¦ EXAMPLES π¦
Here's the moment you've been waiting for:
$ git var GIT_AUTHOR_IDENT
Eric W. Biederman <ebiederm@lnxi.com> 1121223278 -0600
Look at that output. Iconic. No notes. π
π VARIABLES π
Okay so here's the full lineup of variables you can ask about. Every single one, bestie. I'm not skipping a single one because that would be rude. π
GIT_AUTHOR_IDENTβ the author of a piece of code. Like, who wrote this masterpiece? That's them. πGIT_COMMITTER_IDENTβ the person who put a piece of code into Git. The one who actually committed it. Big main character energy. πGIT_EDITORβ text editor for use by Git commands. The value is meant to be interpreted by the shell when it is used. Examples:~/bin/vi,$SOME_ENVIRONMENT_VARIABLE,"C:\Program Files\Vim\gvim.exe" --nofork. The order of preference is$GIT_EDITOR, thencore.editorconfiguration value, then$VISUAL, then$EDITOR, and then the default chosen at compile time, which is usuallyvi. So like, it checks all these spots in order until it finds one. Respect the hierarchy. π«‘GIT_SEQUENCE_EDITORβ text editor used to edit the todo file while runninggit rebase -i. LikeGIT_EDITOR, the value is meant to be interpreted by the shell when it is used. The order of preference is$GIT_SEQUENCE_EDITOR, thensequence.editorconfiguration value, and then the value ofgit var GIT_EDITOR. So it's like the editor's editor. Very meta. πGIT_PAGERβ text viewer for use by Git commands (e.g.,less). The value is meant to be interpreted by the shell. The order of preference is$GIT_PAGER, then the value ofcore.pagerconfiguration, then$PAGER, and then the default chosen at compile time (usuallyless). So when you're scrolling through a huge diff, this is the vibe responsible. πGIT_DEFAULT_BRANCHβ the name of the first branch created in newly initialized repositories. Like when yougit initand it makes that first branch. This is its name. Simple, cute, foundational. π±GIT_SHELL_PATHβ the path of the binary providing the POSIX shell for commands which use the shell. So like, where the shell lives. It's giving "I know where everything is" energy. πGIT_ATTR_SYSTEMβ the path to the systemgitattributes(5)file, if one is enabled. If it's not enabled, you don't get a path. That's just how it is. π€·GIT_ATTR_GLOBALβ the path to the global (per-user)gitattributes(5)file. Your personal attributes file. Make it yours. πGIT_CONFIG_SYSTEMβ the path to the system configuration file, if one is enabled. Same deal β only if it's enabled. π§GIT_CONFIG_GLOBALβ the path to the global (per-user) configuration files, if any. Plural! Because sometimes there's more than one. Keep up. β¨
Okay, important note time, bestie. Most path values contain only one value. But some can contain multiple values, which are separated by newlines, and are listed in order from highest to lowest priority. Callers should be prepared for any such path value to contain multiple items. So like, don't assume it's always a single line. Be ready. That's the vibe check. π§
Also note: paths are printed even if they do not exist, but not if they are disabled by other environment variables. So like, if the path is just hypothetical, you still see it. But if an env var says "nope, disabled," then you don't. Respect the environment variables. They're the bosses here. π
π₯ SEE ALSO π₯
Go read those too. They're all part of the same family. Family reunion. π
π GIT π
Part of the git(1) suite. You know, the whole Git ecosystem. We're all in this together. π
That's the whole page, bestie. Go forth and git var responsibly. And remember: this was Git 2.56.0, dated 2026-09-27. Cute, right? Now go slay some variables. πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms