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/config as well. However β€” and this is the important part β€” that configuration variables listing functionality is deprecated in favor of git 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, then core.editor configuration value, then $VISUAL, then $EDITOR, and then the default chosen at compile time, which is usually vi. 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 running git rebase -i. Like GIT_EDITOR, the value is meant to be interpreted by the shell when it is used. The order of preference is $GIT_SEQUENCE_EDITOR, then sequence.editor configuration value, and then the value of git 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 of core.pager configuration, then $PAGER, and then the default chosen at compile time (usually less). 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 you git init and 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 system gitattributes(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