blob: f71db0daa24358e8589281d06ee48e7cd877bca8 [file] [log] [blame]
Junio C Hamano58256872007-12-04 08:31:131git-help(1)
2===========
3
4NAME
5----
Junio C Hamano076ffcc2013-02-06 05:13:216git-help - Display help information about Git
Junio C Hamano58256872007-12-04 08:31:137
8SYNOPSIS
9--------
Junio C Hamano15567bc2011-07-23 00:51:5910[verse]
Junio C Hamanoabe2c592018-10-19 05:42:5311'git help' [-a|--all [--[no-]verbose]] [-g|--guide]
Junio C Hamano0eb11502013-04-12 02:14:1912 [-i|--info|-m|--man|-w|--web] [COMMAND|GUIDE]
Junio C Hamano58256872007-12-04 08:31:1313
14DESCRIPTION
15-----------
16
Junio C Hamano0eb11502013-04-12 02:14:1917With no options and no COMMAND or GUIDE given, the synopsis of the 'git'
Junio C Hamano076ffcc2013-02-06 05:13:2118command and a list of the most commonly used Git commands are printed
Junio C Hamano58256872007-12-04 08:31:1319on the standard output.
20
Junio C Hamano92d80372016-07-13 22:00:0521If the option `--all` or `-a` is given, all available commands are
Junio C Hamano58256872007-12-04 08:31:1322printed on the standard output.
23
Junio C Hamano92d80372016-07-13 22:00:0524If the option `--guide` or `-g` is given, a list of the useful
Junio C Hamano0eb11502013-04-12 02:14:1925Git 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.
Junio C Hamano58256872007-12-04 08:31:1331
Junio C Hamanoa4df8ed2018-10-26 06:37:1332If an alias is given, git shows the definition of the alias on
33standard output. To get the manual page for the aliased command, use
34`git COMMAND --help`.
35
Junio C Hamanoba4b9282008-07-06 05:20:3136Note that `git --help ...` is identical to `git help ...` because the
Junio C Hamano58256872007-12-04 08:31:1337former is internally converted into the latter.
38
Junio C Hamano0eb11502013-04-12 02:14:1939To display the linkgit:git[1] man page, use `git help git`.
40
41This page can be displayed with 'git help help' or `git help --help`
42
Junio C Hamano58256872007-12-04 08:31:1343OPTIONS
44-------
Junio C Hamanoeb415992008-06-08 22:49:4745-a::
46--all::
Junio C Hamano58256872007-12-04 08:31:1347Prints all the available commands on the standard output. This
Junio C Hamano0eb11502013-04-12 02:14:1948option overrides any given command or guide name.
Junio C Hamanoabe2c592018-10-19 05:42:5349
50--verbose::
51When used with `--all` print description for all recognized
52commands. This is the default.
Junio C Hamano0eb11502013-04-12 02:14:1953
Junio C Hamanoec40f132018-06-28 21:40:5754-c::
55--config::
56List all available configuration variables. This is a short
57summary of the list in linkgit:git-config[1].
58
Junio C Hamano0eb11502013-04-12 02:14:1959-g::
60--guides::
61Prints a list of useful guides on the standard output. This
62option overrides any given command or guide name.
Junio C Hamano58256872007-12-04 08:31:1363
Junio C Hamanoeb415992008-06-08 22:49:4764-i::
65--info::
Junio C Hamano8b588d52008-03-15 09:48:3766Display manual page for the command in the 'info' format. The
67'info' program will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3068
Junio C Hamanoeb415992008-06-08 22:49:4769-m::
70--man::
Junio C Hamano8b588d52008-03-15 09:48:3771Display manual page for the command in the 'man' format. This
72option may be used to override a value set in the
Junio C Hamano042f2142016-06-27 18:05:0573`help.format` configuration variable.
Junio C Hamano8b588d52008-03-15 09:48:3774+
75By default the 'man' program will be used to display the manual page,
Junio C Hamano042f2142016-06-27 18:05:0576but the `man.viewer` configuration variable may be used to choose
Junio C Hamano8b588d52008-03-15 09:48:3777other display programs (see below).
Junio C Hamano3dac5042007-12-15 08:40:5478
Junio C Hamanoeb415992008-06-08 22:49:4779-w::
80--web::
Junio C Hamano8b588d52008-03-15 09:48:3781Display manual page for the command in the 'web' (HTML)
82format. A web browser will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3083+
84The web browser can be specified using the configuration variable
Junio C Hamano042f2142016-06-27 18:05:0585`help.browser`, or `web.browser` if the former is not set. If none of
Junio C Hamano2db3e752010-09-03 21:33:0686these config variables is set, the 'git web{litdd}browse' helper script
Junio C Hamano1aa40d22010-01-21 17:46:4387(called by 'git help') will pick a suitable default. See
Junio C Hamano2db3e752010-09-03 21:33:0688linkgit:git-web{litdd}browse[1] for more information about this.
Junio C Hamano0c0da5f2007-12-13 02:45:3089
Junio C Hamano3dac5042007-12-15 08:40:5490CONFIGURATION VARIABLES
91-----------------------
92
Junio C Hamano8b588d52008-03-15 09:48:3793help.format
94~~~~~~~~~~~
95
Junio C Hamano042f2142016-06-27 18:05:0596If no command-line option is passed, the `help.format` configuration
Junio C Hamano3dac5042007-12-15 08:40:5497variable will be checked. The following values are supported for this
Junio C Hamanoe1aeb5e2014-06-06 19:16:2998variable; they make 'git help' behave as their corresponding command-
Junio C Hamano3dac5042007-12-15 08:40:5499line option:
100
101* "man" corresponds to '-m|--man',
102* "info" corresponds to '-i|--info',
Junio C Hamano8b588d52008-03-15 09:48:37103* "web" or "html" correspond to '-w|--web'.
104
105help.browser, web.browser and browser.<tool>.path
106~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano3dac5042007-12-15 08:40:54107
Junio C Hamano042f2142016-06-27 18:05:05108The `help.browser`, `web.browser` and `browser.<tool>.path` will also
Junio C Hamanoe1aeb5e2014-06-06 19:16:29109be checked if the 'web' format is chosen (either by command-line
Junio C Hamano3dac5042007-12-15 08:40:54110option or configuration variable). See '-w|--web' in the OPTIONS
Junio C Hamano2db3e752010-09-03 21:33:06111section above and linkgit:git-web{litdd}browse[1].
Junio C Hamano3dac5042007-12-15 08:40:54112
Junio C Hamano8b588d52008-03-15 09:48:37113man.viewer
114~~~~~~~~~~
115
Junio C Hamano042f2142016-06-27 18:05:05116The `man.viewer` configuration variable will be checked if the 'man'
Junio C Hamanoe1aeb5e2014-06-06 19:16:29117format is chosen. The following values are currently supported:
Junio C Hamano8b588d52008-03-15 09:48:37118
119* "man": use the 'man' program as usual,
120* "woman": use 'emacsclient' to launch the "woman" mode in emacs
Junio C Hamano2567b322019-02-05 23:33:56121 (this only works starting with emacsclient versions 22),
Junio C Hamano6d76d612008-05-09 05:46:08122* "konqueror": use 'kfmclient' to open the man page in a new konqueror
Junio C Hamano2567b322019-02-05 23:33:56123 tab (see 'Note about konqueror' below).
Junio C Hamano8b588d52008-03-15 09:48:37124
Junio C Hamano6d76d612008-05-09 05:46:08125Values for other tools can be used if there is a corresponding
Junio C Hamano042f2142016-06-27 18:05:05126`man.<tool>.cmd` configuration entry (see below).
Junio C Hamano6d76d612008-05-09 05:46:08127
Junio C Hamano042f2142016-06-27 18:05:05128Multiple values may be given to the `man.viewer` configuration
Junio C Hamano6d76d612008-05-09 05:46:08129variable. Their corresponding programs will be tried in the order
130listed in the configuration file.
Junio C Hamano8b588d52008-03-15 09:48:37131
132For example, this configuration:
133
Junio C Hamano6d76d612008-05-09 05:46:08134------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37135[man]
136viewer = konqueror
137viewer = woman
Junio C Hamano6d76d612008-05-09 05:46:08138------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37139
Junio C Hamanoe1aeb5e2014-06-06 19:16:29140will try to use konqueror first. But this may fail (for example, if
Junio C Hamano8b588d52008-03-15 09:48:37141DISPLAY is not set) and in that case emacs' woman mode will be tried.
142
Junio C Hamanoa2f46622008-09-03 05:20:31143If everything fails, or if no viewer is configured, the viewer specified
Junio C Hamano042f2142016-06-27 18:05:05144in the `GIT_MAN_VIEWER` environment variable will be tried. If that
Junio C Hamanoa2f46622008-09-03 05:20:31145fails too, the 'man' program will be tried anyway.
Junio C Hamano8b588d52008-03-15 09:48:37146
Junio C Hamano6d76d612008-05-09 05:46:08147man.<tool>.path
148~~~~~~~~~~~~~~~
149
150You can explicitly provide a full path to your preferred man viewer by
Junio C Hamano042f2142016-06-27 18:05:05151setting the configuration variable `man.<tool>.path`. For example, you
Junio C Hamano6d76d612008-05-09 05:46:08152can configure the absolute path to konqueror by setting
Junio C Hamano1aa40d22010-01-21 17:46:43153'man.konqueror.path'. Otherwise, 'git help' assumes the tool is
Junio C Hamano6d76d612008-05-09 05:46:08154available in PATH.
155
156man.<tool>.cmd
157~~~~~~~~~~~~~~
158
Junio C Hamano042f2142016-06-27 18:05:05159When the man viewer, specified by the `man.viewer` configuration
Junio C Hamano6d76d612008-05-09 05:46:08160variables, is not among the supported ones, then the corresponding
Junio C Hamano042f2142016-06-27 18:05:05161`man.<tool>.cmd` configuration variable will be looked up. If this
Junio C Hamano6d76d612008-05-09 05:46:08162variable exists then the specified tool will be treated as a custom
163command and a shell eval will be used to run the command with the man
164page passed as arguments.
165
166Note about konqueror
167~~~~~~~~~~~~~~~~~~~~
168
Junio C Hamano042f2142016-06-27 18:05:05169When 'konqueror' is specified in the `man.viewer` configuration
Junio C Hamano6d76d612008-05-09 05:46:08170variable, we launch 'kfmclient' to try to open the man page on an
171already opened konqueror in a new tab if possible.
172
173For consistency, we also try such a trick if 'man.konqueror.path' is
Junio C Hamanob5513772019-04-22 03:38:39174set to something like `A_PATH_TO/konqueror`. That means we will try to
175launch `A_PATH_TO/kfmclient` instead.
Junio C Hamano6d76d612008-05-09 05:46:08176
177If you really want to use 'konqueror', then you can use something like
178the following:
179
180------------------------------------------------
181[man]
182viewer = konq
183
184[man "konq"]
185cmd = A_PATH_TO/konqueror
186------------------------------------------------
187
Junio C Hamano8b588d52008-03-15 09:48:37188Note about git config --global
189~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
190
191Note that all these configuration variables should probably be set
Junio C Hamano92d80372016-07-13 22:00:05192using the `--global` flag, for example like this:
Junio C Hamano3dac5042007-12-15 08:40:54193
194------------------------------------------------
195$ git config --global help.format web
196$ git config --global web.browser firefox
197------------------------------------------------
198
199as they are probably more user specific than repository specific.
Junio C Hamano35738e82008-01-07 07:55:46200See linkgit:git-config[1] for more information about this.
Junio C Hamano3dac5042007-12-15 08:40:54201
Junio C Hamano58256872007-12-04 08:31:13202GIT
203---
Junio C Hamanof7c042d2008-06-06 22:50:53204Part of the linkgit:git[1] suite