简体中文 ▾ Topics ▾ Latest version ▾ git-var last updated in 2.50.0

名称

git-var - 显示 Git 逻辑变量

概述

git var (-l | <variable>)

描述

打印 Git 逻辑变量。如果变量没有值,则以代码 1 退出。

选项

-l

显示逻辑变量。此外,Git 配置文件 .git/config 中的所有变量也会被列出。(不过,配置变量列表功能已被弃用,改用 git config -l

实例

$ git var GIT_AUTHOR_IDENT
Eric W. Biederman <ebiederm@lnxi.com> 1121223278 -0600

变量

GIT_AUTHOR_IDENT

一段代码的作者。

GIT_COMMITTER_IDENT

将代码放入 Git 的人。

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.

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.

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).

GIT_DEFAULT_BRANCH

在新初始化的仓库中创建的第一个分支的名称。

GIT_SHELL_PATH

为使用 shell 的命令提供 POSIX shell 的二进制文件路径。

GIT_ATTR_SYSTEM

系统 gitattributes[5] 文件的路径(如果已启用)。

GIT_ATTR_GLOBAL

全局(每个用户)gitattributes[5] 文件的路径。

GIT_CONFIG_SYSTEM

系统配置文件的路径(如果已启用)。

GIT_CONFIG_GLOBAL

全局(按用户)配置文件的路径(如果有)。

大多数路径值只包含一个值。不过,有些路径值可能包含多个值,这些值之间用换行分隔,并按优先级从高到低排列。 调用者应做好任何此类路径值包含多个项目的准备。

请注意,即使路径不存在,也会打印出来,但如果路径被其他环境变量禁用,则不会打印出来。

GIT

属于 git[1] 文档

scroll-to-top