]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-help.txt
Merge branch 'ds/commit-graph-fsck'
[thirdparty/git.git] / Documentation / git-help.txt
CommitLineData
0f6f195b 1git-help(1)
dada0c12 2===========
0f6f195b
CC
3
4NAME
5----
2de9b711 6git-help - Display help information about Git
0f6f195b
CC
7
8SYNOPSIS
9--------
7791a1d9 10[verse]
63eae83f 11'git help' [-a|--all [--verbose]] [-g|--guide]
a133737b 12 [-i|--info|-m|--man|-w|--web] [COMMAND|GUIDE]
0f6f195b
CC
13
14DESCRIPTION
15-----------
16
a133737b 17With no options and no COMMAND or GUIDE given, the synopsis of the 'git'
2de9b711 18command and a list of the most commonly used Git commands are printed
0f6f195b
CC
19on the standard output.
20
bcf9626a 21If the option `--all` or `-a` is given, all available commands are
0f6f195b
CC
22printed on the standard output.
23
bcf9626a 24If the option `--guide` or `-g` is given, a list of the useful
a133737b
PO
25Git guides is also printed on the standard output.
26
27If a command, or a guide, is given, a manual page for that command or
28guide is brought up. The 'man' program is used by default for this
29purpose, but this can be overridden by other options or configuration
30variables.
0f6f195b 31
db5d6666 32Note that `git --help ...` is identical to `git help ...` because the
0f6f195b
CC
33former is internally converted into the latter.
34
a133737b
PO
35To display the linkgit:git[1] man page, use `git help git`.
36
37This page can be displayed with 'git help help' or `git help --help`
38
0f6f195b
CC
39OPTIONS
40-------
3240240f
SB
41-a::
42--all::
0f6f195b 43 Prints all the available commands on the standard output. This
a133737b 44 option overrides any given command or guide name.
63eae83f
NTND
45 When used with `--verbose` print description for all recognized
46 commands.
a133737b 47
3ac68a93
NTND
48-c::
49--config::
50 List all available configuration variables. This is a short
51 summary of the list in linkgit:git-config[1].
52
a133737b
PO
53-g::
54--guides::
55 Prints a list of useful guides on the standard output. This
56 option overrides any given command or guide name.
0f6f195b 57
3240240f
SB
58-i::
59--info::
b5578f33
CC
60 Display manual page for the command in the 'info' format. The
61 'info' program will be used for that purpose.
45533d26 62
3240240f
SB
63-m::
64--man::
b5578f33
CC
65 Display manual page for the command in the 'man' format. This
66 option may be used to override a value set in the
ae9f6311 67 `help.format` configuration variable.
b5578f33
CC
68+
69By default the 'man' program will be used to display the manual page,
ae9f6311 70but the `man.viewer` configuration variable may be used to choose
b8322ea8 71other display programs (see below).
70087cdb 72
3240240f
SB
73-w::
74--web::
b5578f33
CC
75 Display manual page for the command in the 'web' (HTML)
76 format. A web browser will be used for that purpose.
c07a07c5
CC
77+
78The web browser can be specified using the configuration variable
ae9f6311 79`help.browser`, or `web.browser` if the former is not set. If none of
28394787 80these config variables is set, the 'git web{litdd}browse' helper script
0b444cdb 81(called by 'git help') will pick a suitable default. See
28394787 82linkgit:git-web{litdd}browse[1] for more information about this.
c07a07c5 83
70087cdb
CC
84CONFIGURATION VARIABLES
85-----------------------
86
b8322ea8
CC
87help.format
88~~~~~~~~~~~
89
ae9f6311 90If no command-line option is passed, the `help.format` configuration
70087cdb 91variable will be checked. The following values are supported for this
06ab60c0 92variable; they make 'git help' behave as their corresponding command-
70087cdb
CC
93line option:
94
95* "man" corresponds to '-m|--man',
96* "info" corresponds to '-i|--info',
b5578f33 97* "web" or "html" correspond to '-w|--web'.
70087cdb 98
b8322ea8
CC
99help.browser, web.browser and browser.<tool>.path
100~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101
ae9f6311 102The `help.browser`, `web.browser` and `browser.<tool>.path` will also
06ab60c0 103be checked if the 'web' format is chosen (either by command-line
70087cdb 104option or configuration variable). See '-w|--web' in the OPTIONS
28394787 105section above and linkgit:git-web{litdd}browse[1].
70087cdb 106
b8322ea8
CC
107man.viewer
108~~~~~~~~~~
109
ae9f6311 110The `man.viewer` configuration variable will be checked if the 'man'
06ab60c0 111format is chosen. The following values are currently supported:
b5578f33
CC
112
113* "man": use the 'man' program as usual,
114* "woman": use 'emacsclient' to launch the "woman" mode in emacs
115(this only works starting with emacsclient versions 22),
0bb64009
CC
116* "konqueror": use 'kfmclient' to open the man page in a new konqueror
117tab (see 'Note about konqueror' below).
b5578f33 118
0bb64009 119Values for other tools can be used if there is a corresponding
ae9f6311 120`man.<tool>.cmd` configuration entry (see below).
0bb64009 121
ae9f6311 122Multiple values may be given to the `man.viewer` configuration
0bb64009
CC
123variable. Their corresponding programs will be tried in the order
124listed in the configuration file.
b8322ea8
CC
125
126For example, this configuration:
127
0bb64009 128------------------------------------------------
b8322ea8
CC
129 [man]
130 viewer = konqueror
131 viewer = woman
0bb64009 132------------------------------------------------
b8322ea8 133
06ab60c0 134will try to use konqueror first. But this may fail (for example, if
b8322ea8
CC
135DISPLAY is not set) and in that case emacs' woman mode will be tried.
136
5059a427 137If everything fails, or if no viewer is configured, the viewer specified
47d81b5c 138in the `GIT_MAN_VIEWER` environment variable will be tried. If that
5059a427 139fails too, the 'man' program will be tried anyway.
b8322ea8 140
7e8114c0
CC
141man.<tool>.path
142~~~~~~~~~~~~~~~
143
144You can explicitly provide a full path to your preferred man viewer by
ae9f6311 145setting the configuration variable `man.<tool>.path`. For example, you
7e8114c0 146can configure the absolute path to konqueror by setting
0b444cdb 147'man.konqueror.path'. Otherwise, 'git help' assumes the tool is
7e8114c0
CC
148available in PATH.
149
0bb64009
CC
150man.<tool>.cmd
151~~~~~~~~~~~~~~
152
ae9f6311 153When the man viewer, specified by the `man.viewer` configuration
0bb64009 154variables, is not among the supported ones, then the corresponding
ae9f6311 155`man.<tool>.cmd` configuration variable will be looked up. If this
0bb64009
CC
156variable exists then the specified tool will be treated as a custom
157command and a shell eval will be used to run the command with the man
158page passed as arguments.
159
160Note about konqueror
161~~~~~~~~~~~~~~~~~~~~
162
ae9f6311 163When 'konqueror' is specified in the `man.viewer` configuration
0bb64009
CC
164variable, we launch 'kfmclient' to try to open the man page on an
165already opened konqueror in a new tab if possible.
166
167For consistency, we also try such a trick if 'man.konqueror.path' is
168set to something like 'A_PATH_TO/konqueror'. That means we will try to
169launch 'A_PATH_TO/kfmclient' instead.
170
171If you really want to use 'konqueror', then you can use something like
172the following:
173
174------------------------------------------------
175 [man]
176 viewer = konq
177
178 [man "konq"]
179 cmd = A_PATH_TO/konqueror
180------------------------------------------------
181
b8322ea8
CC
182Note about git config --global
183~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184
b5578f33 185Note that all these configuration variables should probably be set
bcf9626a 186using the `--global` flag, for example like this:
70087cdb
CC
187
188------------------------------------------------
189$ git config --global help.format web
190$ git config --global web.browser firefox
191------------------------------------------------
192
193as they are probably more user specific than repository specific.
5162e697 194See linkgit:git-config[1] for more information about this.
70087cdb 195
0f6f195b
CC
196GIT
197---
9e1f0a85 198Part of the linkgit:git[1] suite