{
    "mode": "man",
    "parameter": "GIT-VAR",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/GIT-VAR/json",
    "generated": "2026-10-22T13:16:30Z",
    "synopsis": "git var (-l | <variable>)",
    "sections": {
        "NAME": {
            "content": "git-var - Show a Git logical variable\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "git var (-l | <variable>)\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Prints a Git logical variable. Exits with code 1 if the variable has no value.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-l",
                    "content": "Display the logical variables. In addition, all the variables of the Git configuration\nfile .git/config are listed as well. (However, the configuration variables listing\nfunctionality is deprecated in favor of git config -l.)\n",
                    "flag": "-l"
                }
            ]
        },
        "EXAMPLES": {
            "content": "$ git var GITAUTHORIDENT\nEric W. Biederman <ebiederm@lnxi.com> 1121223278 -0600\n",
            "subsections": []
        },
        "VARIABLES": {
            "content": "GITAUTHORIDENT\nThe author of a piece of code.\n\nGITCOMMITTERIDENT\nThe person who put a piece of code into Git.\n\nGITEDITOR\nText editor for use by Git commands. The value is meant to be interpreted by the shell\nwhen it is used. Examples: ~/bin/vi, $SOMEENVIRONMENTVARIABLE, \"C:\\Program\nFiles\\Vim\\gvim.exe\" --nofork. The order of preference is the $GITEDITOR environment\nvariable, then core.editor configuration, then $VISUAL, then $EDITOR, and then the\ndefault chosen at compile time, which is usually vi. The build you are using chose editor\nas the default.\n\nGITSEQUENCEEDITOR\nText editor used to edit the todo file while running git rebase -i. Like GITEDITOR, the\nvalue is meant to be interpreted by the shell when it is used. The order of preference is\nthe $GITSEQUENCEEDITOR environment variable, then sequence.editor configuration, and\nthen the value of git var GITEDITOR.\n\nGITPAGER\nText viewer for use by Git commands (e.g., less). The value is meant to be interpreted by\nthe shell. The order of preference is the $GITPAGER environment variable, then\ncore.pager configuration, then $PAGER, and then the default chosen at compile time\n(usually less). The build you are using chose pager as the default.\n\nGITDEFAULTBRANCH\nThe name of the first branch created in newly initialized repositories.\n\nGITSHELLPATH\nThe path of the binary providing the POSIX shell for commands which use the shell.\n\nGITATTRSYSTEM\nThe path to the system gitattributes(5) file, if one is enabled.\n\nGITATTRGLOBAL\nThe path to the global (per-user) gitattributes(5) file.\n\nGITCONFIGSYSTEM\nThe path to the system configuration file, if one is enabled.\n\nGITCONFIGGLOBAL\nThe path to the global (per-user) configuration files, if any.\n\nMost path values contain only one value. However, some can contain multiple values, which are\nseparated by newlines, and are listed in order from highest to lowest priority. Callers\nshould be prepared for any such path value to contain multiple items.\n\nNote that paths are printed even if they do not exist, but not if they are disabled by other\nenvironment variables.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "git-commit-tree(1) git-tag(1) git-config(1)\n",
            "subsections": []
        },
        "GIT": {
            "content": "Part of the git(1) suite\n\nGit 2.43.0                                   07/02/2025                                   GIT-VAR(1)",
            "subsections": []
        }
    },
    "summary": "git-var - Show a Git logical variable",
    "flags": [
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "Display the logical variables. In addition, all the variables of the Git configuration file .git/config are listed as well. (However, the configuration variables listing functionality is deprecated in favor of git config -l.)"
        }
    ],
    "examples": [
        "$ git var GITAUTHORIDENT",
        "Eric W. Biederman <ebiederm@lnxi.com> 1121223278 -0600"
    ],
    "see_also": [
        {
            "name": "git-commit-tree",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-commit-tree/1/json"
        },
        {
            "name": "git-tag",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-tag/1/json"
        },
        {
            "name": "git-config",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-config/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Print a Git logical variable's value.",
        "examples": [
            {
                "description": "Print the value of a Git logical variable",
                "command": "git var {{GIT_AUTHOR_IDENT|GIT_COMMITTER_IDENT|GIT_EDITOR|GIT_PAGER}}"
            },
            {
                "description": "[l]ist all Git logical variables",
                "command": "git var -l"
            }
        ]
    }
}