blob: eccd0ffd384bf90f1846bf4cfeb7670dbd64cb6e [file] [log] [blame]
Junio C Hamano58256872007-12-04 08:31:131git-help(1)
2===========
3
4NAME
5----
6git-help - display help information about git
7
8SYNOPSIS
9--------
Junio C Hamano3dac5042007-12-15 08:40:5410'git help' [-a|--all|-i|--info|-m|--man|-w|--web] [COMMAND]
Junio C Hamano58256872007-12-04 08:31:1311
12DESCRIPTION
13-----------
14
15With no options and no COMMAND given, the synopsis of the 'git'
16command and a list of the most commonly used git commands are printed
17on the standard output.
18
19If the option '--all' or '-a' is given, then all available commands are
20printed on the standard output.
21
22If a git command is named, a manual page for that command is brought
Junio C Hamano0c0da5f2007-12-13 02:45:3023up. The 'man' program is used by default for this purpose, but this
Junio C Hamanofe986052007-12-19 07:33:3824can be overridden by other options or configuration variables.
Junio C Hamano58256872007-12-04 08:31:1325
Junio C Hamanoba4b9282008-07-06 05:20:3126Note that `git --help ...` is identical to `git help ...` because the
Junio C Hamano58256872007-12-04 08:31:1327former is internally converted into the latter.
28
29OPTIONS
30-------
Junio C Hamanoeb415992008-06-08 22:49:4731-a::
32--all::
Junio C Hamano58256872007-12-04 08:31:1333Prints all the available commands on the standard output. This
Junio C Hamanofe986052007-12-19 07:33:3834option supersedes any other option.
Junio C Hamano58256872007-12-04 08:31:1335
Junio C Hamanoeb415992008-06-08 22:49:4736-i::
37--info::
Junio C Hamano8b588d52008-03-15 09:48:3738Display manual page for the command in the 'info' format. The
39'info' program will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3040
Junio C Hamanoeb415992008-06-08 22:49:4741-m::
42--man::
Junio C Hamano8b588d52008-03-15 09:48:3743Display manual page for the command in the 'man' format. This
44option may be used to override a value set in the
45'help.format' configuration variable.
46+
47By default the 'man' program will be used to display the manual page,
48but the 'man.viewer' configuration variable may be used to choose
49other display programs (see below).
Junio C Hamano3dac5042007-12-15 08:40:5450
Junio C Hamanoeb415992008-06-08 22:49:4751-w::
52--web::
Junio C Hamano8b588d52008-03-15 09:48:3753Display manual page for the command in the 'web' (HTML)
54format. A web browser will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3055+
56The web browser can be specified using the configuration variable
57'help.browser', or 'web.browser' if the former is not set. If none of
Junio C Hamano2db3e752010-09-03 21:33:0658these config variables is set, the 'git web{litdd}browse' helper script
Junio C Hamano1aa40d22010-01-21 17:46:4359(called by 'git help') will pick a suitable default. See
Junio C Hamano2db3e752010-09-03 21:33:0660linkgit:git-web{litdd}browse[1] for more information about this.
Junio C Hamano0c0da5f2007-12-13 02:45:3061
Junio C Hamano3dac5042007-12-15 08:40:5462CONFIGURATION VARIABLES
63-----------------------
64
Junio C Hamano8b588d52008-03-15 09:48:3765help.format
66~~~~~~~~~~~
67
Junio C Hamano3dac5042007-12-15 08:40:5468If no command line option is passed, the 'help.format' configuration
69variable will be checked. The following values are supported for this
Junio C Hamano1aa40d22010-01-21 17:46:4370variable; they make 'git help' behave as their corresponding command
Junio C Hamano3dac5042007-12-15 08:40:5471line option:
72
73* "man" corresponds to '-m|--man',
74* "info" corresponds to '-i|--info',
Junio C Hamano8b588d52008-03-15 09:48:3775* "web" or "html" correspond to '-w|--web'.
76
77help.browser, web.browser and browser.<tool>.path
78~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano3dac5042007-12-15 08:40:5479
80The 'help.browser', 'web.browser' and 'browser.<tool>.path' will also
Junio C Hamanofe986052007-12-19 07:33:3881be checked if the 'web' format is chosen (either by command line
Junio C Hamano3dac5042007-12-15 08:40:5482option or configuration variable). See '-w|--web' in the OPTIONS
Junio C Hamano2db3e752010-09-03 21:33:0683section above and linkgit:git-web{litdd}browse[1].
Junio C Hamano3dac5042007-12-15 08:40:5484
Junio C Hamano8b588d52008-03-15 09:48:3785man.viewer
86~~~~~~~~~~
87
88The 'man.viewer' config variable will be checked if the 'man' format
Junio C Hamano6d76d612008-05-09 05:46:0889is chosen. The following values are currently supported:
Junio C Hamano8b588d52008-03-15 09:48:3790
91* "man": use the 'man' program as usual,
92* "woman": use 'emacsclient' to launch the "woman" mode in emacs
93(this only works starting with emacsclient versions 22),
Junio C Hamano6d76d612008-05-09 05:46:0894* "konqueror": use 'kfmclient' to open the man page in a new konqueror
95tab (see 'Note about konqueror' below).
Junio C Hamano8b588d52008-03-15 09:48:3796
Junio C Hamano6d76d612008-05-09 05:46:0897Values for other tools can be used if there is a corresponding
98'man.<tool>.cmd' configuration entry (see below).
99
100Multiple values may be given to the 'man.viewer' configuration
101variable. Their corresponding programs will be tried in the order
102listed in the configuration file.
Junio C Hamano8b588d52008-03-15 09:48:37103
104For example, this configuration:
105
Junio C Hamano6d76d612008-05-09 05:46:08106------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37107[man]
108viewer = konqueror
109viewer = woman
Junio C Hamano6d76d612008-05-09 05:46:08110------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37111
112will try to use konqueror first. But this may fail (for example if
113DISPLAY is not set) and in that case emacs' woman mode will be tried.
114
Junio C Hamanoa2f46622008-09-03 05:20:31115If everything fails, or if no viewer is configured, the viewer specified
116in the GIT_MAN_VIEWER environment variable will be tried. If that
117fails too, the 'man' program will be tried anyway.
Junio C Hamano8b588d52008-03-15 09:48:37118
Junio C Hamano6d76d612008-05-09 05:46:08119man.<tool>.path
120~~~~~~~~~~~~~~~
121
122You can explicitly provide a full path to your preferred man viewer by
123setting the configuration variable 'man.<tool>.path'. For example, you
124can configure the absolute path to konqueror by setting
Junio C Hamano1aa40d22010-01-21 17:46:43125'man.konqueror.path'. Otherwise, 'git help' assumes the tool is
Junio C Hamano6d76d612008-05-09 05:46:08126available in PATH.
127
128man.<tool>.cmd
129~~~~~~~~~~~~~~
130
131When the man viewer, specified by the 'man.viewer' configuration
132variables, is not among the supported ones, then the corresponding
133'man.<tool>.cmd' configuration variable will be looked up. If this
134variable exists then the specified tool will be treated as a custom
135command and a shell eval will be used to run the command with the man
136page passed as arguments.
137
138Note about konqueror
139~~~~~~~~~~~~~~~~~~~~
140
141When 'konqueror' is specified in the 'man.viewer' configuration
142variable, we launch 'kfmclient' to try to open the man page on an
143already opened konqueror in a new tab if possible.
144
145For consistency, we also try such a trick if 'man.konqueror.path' is
146set to something like 'A_PATH_TO/konqueror'. That means we will try to
147launch 'A_PATH_TO/kfmclient' instead.
148
149If you really want to use 'konqueror', then you can use something like
150the following:
151
152------------------------------------------------
153[man]
154viewer = konq
155
156[man "konq"]
157cmd = A_PATH_TO/konqueror
158------------------------------------------------
159
Junio C Hamano8b588d52008-03-15 09:48:37160Note about git config --global
161~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162
163Note that all these configuration variables should probably be set
164using the '--global' flag, for example like this:
Junio C Hamano3dac5042007-12-15 08:40:54165
166------------------------------------------------
167$ git config --global help.format web
168$ git config --global web.browser firefox
169------------------------------------------------
170
171as they are probably more user specific than repository specific.
Junio C Hamano35738e82008-01-07 07:55:46172See linkgit:git-config[1] for more information about this.
Junio C Hamano3dac5042007-12-15 08:40:54173
Junio C Hamano58256872007-12-04 08:31:13174Author
175------
176Written by Junio C Hamano <gitster@pobox.com> and the git-list
177<git@vger.kernel.org>.
178
179Documentation
180-------------
Junio C Hamanof7c042d2008-06-06 22:50:53181Initial documentation was part of the linkgit:git[1] man page.
Junio C Hamano58256872007-12-04 08:31:13182Christian Couder <chriscool@tuxfamily.org> extracted and rewrote it a
183little. Maintenance is done by the git-list <git@vger.kernel.org>.
184
185GIT
186---
Junio C Hamanof7c042d2008-06-06 22:50:53187Part of the linkgit:git[1] suite