blob: 9e0b3f68116321dfb6a01f0095c6cdfa5a1a4f20 [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 Hamano15567bc2011-07-23 00:51:5910[verse]
Junio C Hamano3dac5042007-12-15 08:40:5411'git help' [-a|--all|-i|--info|-m|--man|-w|--web] [COMMAND]
Junio C Hamano58256872007-12-04 08:31:1312
13DESCRIPTION
14-----------
15
16With no options and no COMMAND given, the synopsis of the 'git'
17command and a list of the most commonly used git commands are printed
18on the standard output.
19
20If the option '--all' or '-a' is given, then all available commands are
21printed on the standard output.
22
23If a git command is named, a manual page for that command is brought
Junio C Hamano0c0da5f2007-12-13 02:45:3024up. The 'man' program is used by default for this purpose, but this
Junio C Hamanofe986052007-12-19 07:33:3825can be overridden by other options or configuration variables.
Junio C Hamano58256872007-12-04 08:31:1326
Junio C Hamanoba4b9282008-07-06 05:20:3127Note that `git --help ...` is identical to `git help ...` because the
Junio C Hamano58256872007-12-04 08:31:1328former is internally converted into the latter.
29
30OPTIONS
31-------
Junio C Hamanoeb415992008-06-08 22:49:4732-a::
33--all::
Junio C Hamano58256872007-12-04 08:31:1334Prints all the available commands on the standard output. This
Junio C Hamanofe986052007-12-19 07:33:3835option supersedes any other option.
Junio C Hamano58256872007-12-04 08:31:1336
Junio C Hamanoeb415992008-06-08 22:49:4737-i::
38--info::
Junio C Hamano8b588d52008-03-15 09:48:3739Display manual page for the command in the 'info' format. The
40'info' program will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3041
Junio C Hamanoeb415992008-06-08 22:49:4742-m::
43--man::
Junio C Hamano8b588d52008-03-15 09:48:3744Display manual page for the command in the 'man' format. This
45option may be used to override a value set in the
46'help.format' configuration variable.
47+
48By default the 'man' program will be used to display the manual page,
49but the 'man.viewer' configuration variable may be used to choose
50other display programs (see below).
Junio C Hamano3dac5042007-12-15 08:40:5451
Junio C Hamanoeb415992008-06-08 22:49:4752-w::
53--web::
Junio C Hamano8b588d52008-03-15 09:48:3754Display manual page for the command in the 'web' (HTML)
55format. A web browser will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3056+
57The web browser can be specified using the configuration variable
58'help.browser', or 'web.browser' if the former is not set. If none of
Junio C Hamano2db3e752010-09-03 21:33:0659these config variables is set, the 'git web{litdd}browse' helper script
Junio C Hamano1aa40d22010-01-21 17:46:4360(called by 'git help') will pick a suitable default. See
Junio C Hamano2db3e752010-09-03 21:33:0661linkgit:git-web{litdd}browse[1] for more information about this.
Junio C Hamano0c0da5f2007-12-13 02:45:3062
Junio C Hamano3dac5042007-12-15 08:40:5463CONFIGURATION VARIABLES
64-----------------------
65
Junio C Hamano8b588d52008-03-15 09:48:3766help.format
67~~~~~~~~~~~
68
Junio C Hamano3dac5042007-12-15 08:40:5469If no command line option is passed, the 'help.format' configuration
70variable will be checked. The following values are supported for this
Junio C Hamano1aa40d22010-01-21 17:46:4371variable; they make 'git help' behave as their corresponding command
Junio C Hamano3dac5042007-12-15 08:40:5472line option:
73
74* "man" corresponds to '-m|--man',
75* "info" corresponds to '-i|--info',
Junio C Hamano8b588d52008-03-15 09:48:3776* "web" or "html" correspond to '-w|--web'.
77
78help.browser, web.browser and browser.<tool>.path
79~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano3dac5042007-12-15 08:40:5480
81The 'help.browser', 'web.browser' and 'browser.<tool>.path' will also
Junio C Hamanofe986052007-12-19 07:33:3882be checked if the 'web' format is chosen (either by command line
Junio C Hamano3dac5042007-12-15 08:40:5483option or configuration variable). See '-w|--web' in the OPTIONS
Junio C Hamano2db3e752010-09-03 21:33:0684section above and linkgit:git-web{litdd}browse[1].
Junio C Hamano3dac5042007-12-15 08:40:5485
Junio C Hamano8b588d52008-03-15 09:48:3786man.viewer
87~~~~~~~~~~
88
89The 'man.viewer' config variable will be checked if the 'man' format
Junio C Hamano6d76d612008-05-09 05:46:0890is chosen. The following values are currently supported:
Junio C Hamano8b588d52008-03-15 09:48:3791
92* "man": use the 'man' program as usual,
93* "woman": use 'emacsclient' to launch the "woman" mode in emacs
94(this only works starting with emacsclient versions 22),
Junio C Hamano6d76d612008-05-09 05:46:0895* "konqueror": use 'kfmclient' to open the man page in a new konqueror
96tab (see 'Note about konqueror' below).
Junio C Hamano8b588d52008-03-15 09:48:3797
Junio C Hamano6d76d612008-05-09 05:46:0898Values for other tools can be used if there is a corresponding
99'man.<tool>.cmd' configuration entry (see below).
100
101Multiple values may be given to the 'man.viewer' configuration
102variable. Their corresponding programs will be tried in the order
103listed in the configuration file.
Junio C Hamano8b588d52008-03-15 09:48:37104
105For example, this configuration:
106
Junio C Hamano6d76d612008-05-09 05:46:08107------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37108[man]
109viewer = konqueror
110viewer = woman
Junio C Hamano6d76d612008-05-09 05:46:08111------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37112
113will try to use konqueror first. But this may fail (for example if
114DISPLAY is not set) and in that case emacs' woman mode will be tried.
115
Junio C Hamanoa2f46622008-09-03 05:20:31116If everything fails, or if no viewer is configured, the viewer specified
117in the GIT_MAN_VIEWER environment variable will be tried. If that
118fails too, the 'man' program will be tried anyway.
Junio C Hamano8b588d52008-03-15 09:48:37119
Junio C Hamano6d76d612008-05-09 05:46:08120man.<tool>.path
121~~~~~~~~~~~~~~~
122
123You can explicitly provide a full path to your preferred man viewer by
124setting the configuration variable 'man.<tool>.path'. For example, you
125can configure the absolute path to konqueror by setting
Junio C Hamano1aa40d22010-01-21 17:46:43126'man.konqueror.path'. Otherwise, 'git help' assumes the tool is
Junio C Hamano6d76d612008-05-09 05:46:08127available in PATH.
128
129man.<tool>.cmd
130~~~~~~~~~~~~~~
131
132When the man viewer, specified by the 'man.viewer' configuration
133variables, is not among the supported ones, then the corresponding
134'man.<tool>.cmd' configuration variable will be looked up. If this
135variable exists then the specified tool will be treated as a custom
136command and a shell eval will be used to run the command with the man
137page passed as arguments.
138
139Note about konqueror
140~~~~~~~~~~~~~~~~~~~~
141
142When 'konqueror' is specified in the 'man.viewer' configuration
143variable, we launch 'kfmclient' to try to open the man page on an
144already opened konqueror in a new tab if possible.
145
146For consistency, we also try such a trick if 'man.konqueror.path' is
147set to something like 'A_PATH_TO/konqueror'. That means we will try to
148launch 'A_PATH_TO/kfmclient' instead.
149
150If you really want to use 'konqueror', then you can use something like
151the following:
152
153------------------------------------------------
154[man]
155viewer = konq
156
157[man "konq"]
158cmd = A_PATH_TO/konqueror
159------------------------------------------------
160
Junio C Hamano8b588d52008-03-15 09:48:37161Note about git config --global
162~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163
164Note that all these configuration variables should probably be set
165using the '--global' flag, for example like this:
Junio C Hamano3dac5042007-12-15 08:40:54166
167------------------------------------------------
168$ git config --global help.format web
169$ git config --global web.browser firefox
170------------------------------------------------
171
172as they are probably more user specific than repository specific.
Junio C Hamano35738e82008-01-07 07:55:46173See linkgit:git-config[1] for more information about this.
Junio C Hamano3dac5042007-12-15 08:40:54174
Junio C Hamano58256872007-12-04 08:31:13175GIT
176---
Junio C Hamanof7c042d2008-06-06 22:50:53177Part of the linkgit:git[1] suite