blob: b21e9d79be22cf134cf4e5f009fc8d71a635cc73 [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 Hamano0eb11502013-04-12 02:14:1911'git help' [-a|--all] [-g|--guide]
12 [-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 Hamano0eb11502013-04-12 02:14:1921If 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 Hamano0eb11502013-04-12 02:14:1924If the option '--guide' or '-g' is given, a list of the useful
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.
Junio C Hamano58256872007-12-04 08:31:1331
Junio C Hamanoba4b9282008-07-06 05:20:3132Note that `git --help ...` is identical to `git help ...` because the
Junio C Hamano58256872007-12-04 08:31:1333former is internally converted into the latter.
34
Junio C Hamano0eb11502013-04-12 02:14:1935To 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
Junio C Hamano58256872007-12-04 08:31:1339OPTIONS
40-------
Junio C Hamanoeb415992008-06-08 22:49:4741-a::
42--all::
Junio C Hamano58256872007-12-04 08:31:1343Prints all the available commands on the standard output. This
Junio C Hamano0eb11502013-04-12 02:14:1944option overrides any given command or guide name.
45
46-g::
47--guides::
48Prints a list of useful guides on the standard output. This
49option overrides any given command or guide name.
Junio C Hamano58256872007-12-04 08:31:1350
Junio C Hamanoeb415992008-06-08 22:49:4751-i::
52--info::
Junio C Hamano8b588d52008-03-15 09:48:3753Display manual page for the command in the 'info' format. The
54'info' program will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3055
Junio C Hamanoeb415992008-06-08 22:49:4756-m::
57--man::
Junio C Hamano8b588d52008-03-15 09:48:3758Display manual page for the command in the 'man' format. This
59option may be used to override a value set in the
60'help.format' configuration variable.
61+
62By default the 'man' program will be used to display the manual page,
63but the 'man.viewer' configuration variable may be used to choose
64other display programs (see below).
Junio C Hamano3dac5042007-12-15 08:40:5465
Junio C Hamanoeb415992008-06-08 22:49:4766-w::
67--web::
Junio C Hamano8b588d52008-03-15 09:48:3768Display manual page for the command in the 'web' (HTML)
69format. A web browser will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3070+
71The web browser can be specified using the configuration variable
72'help.browser', or 'web.browser' if the former is not set. If none of
Junio C Hamano2db3e752010-09-03 21:33:0673these config variables is set, the 'git web{litdd}browse' helper script
Junio C Hamano1aa40d22010-01-21 17:46:4374(called by 'git help') will pick a suitable default. See
Junio C Hamano2db3e752010-09-03 21:33:0675linkgit:git-web{litdd}browse[1] for more information about this.
Junio C Hamano0c0da5f2007-12-13 02:45:3076
Junio C Hamano3dac5042007-12-15 08:40:5477CONFIGURATION VARIABLES
78-----------------------
79
Junio C Hamano8b588d52008-03-15 09:48:3780help.format
81~~~~~~~~~~~
82
Junio C Hamano3dac5042007-12-15 08:40:5483If no command line option is passed, the 'help.format' configuration
84variable will be checked. The following values are supported for this
Junio C Hamano1aa40d22010-01-21 17:46:4385variable; they make 'git help' behave as their corresponding command
Junio C Hamano3dac5042007-12-15 08:40:5486line option:
87
88* "man" corresponds to '-m|--man',
89* "info" corresponds to '-i|--info',
Junio C Hamano8b588d52008-03-15 09:48:3790* "web" or "html" correspond to '-w|--web'.
91
92help.browser, web.browser and browser.<tool>.path
93~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano3dac5042007-12-15 08:40:5494
95The 'help.browser', 'web.browser' and 'browser.<tool>.path' will also
Junio C Hamanofe986052007-12-19 07:33:3896be checked if the 'web' format is chosen (either by command line
Junio C Hamano3dac5042007-12-15 08:40:5497option or configuration variable). See '-w|--web' in the OPTIONS
Junio C Hamano2db3e752010-09-03 21:33:0698section above and linkgit:git-web{litdd}browse[1].
Junio C Hamano3dac5042007-12-15 08:40:5499
Junio C Hamano8b588d52008-03-15 09:48:37100man.viewer
101~~~~~~~~~~
102
103The 'man.viewer' config variable will be checked if the 'man' format
Junio C Hamano6d76d612008-05-09 05:46:08104is chosen. The following values are currently supported:
Junio C Hamano8b588d52008-03-15 09:48:37105
106* "man": use the 'man' program as usual,
107* "woman": use 'emacsclient' to launch the "woman" mode in emacs
108(this only works starting with emacsclient versions 22),
Junio C Hamano6d76d612008-05-09 05:46:08109* "konqueror": use 'kfmclient' to open the man page in a new konqueror
110tab (see 'Note about konqueror' below).
Junio C Hamano8b588d52008-03-15 09:48:37111
Junio C Hamano6d76d612008-05-09 05:46:08112Values for other tools can be used if there is a corresponding
113'man.<tool>.cmd' configuration entry (see below).
114
115Multiple values may be given to the 'man.viewer' configuration
116variable. Their corresponding programs will be tried in the order
117listed in the configuration file.
Junio C Hamano8b588d52008-03-15 09:48:37118
119For example, this configuration:
120
Junio C Hamano6d76d612008-05-09 05:46:08121------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37122[man]
123viewer = konqueror
124viewer = woman
Junio C Hamano6d76d612008-05-09 05:46:08125------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37126
127will try to use konqueror first. But this may fail (for example if
128DISPLAY is not set) and in that case emacs' woman mode will be tried.
129
Junio C Hamanoa2f46622008-09-03 05:20:31130If everything fails, or if no viewer is configured, the viewer specified
131in the GIT_MAN_VIEWER environment variable will be tried. If that
132fails too, the 'man' program will be tried anyway.
Junio C Hamano8b588d52008-03-15 09:48:37133
Junio C Hamano6d76d612008-05-09 05:46:08134man.<tool>.path
135~~~~~~~~~~~~~~~
136
137You can explicitly provide a full path to your preferred man viewer by
138setting the configuration variable 'man.<tool>.path'. For example, you
139can configure the absolute path to konqueror by setting
Junio C Hamano1aa40d22010-01-21 17:46:43140'man.konqueror.path'. Otherwise, 'git help' assumes the tool is
Junio C Hamano6d76d612008-05-09 05:46:08141available in PATH.
142
143man.<tool>.cmd
144~~~~~~~~~~~~~~
145
146When the man viewer, specified by the 'man.viewer' configuration
147variables, is not among the supported ones, then the corresponding
148'man.<tool>.cmd' configuration variable will be looked up. If this
149variable exists then the specified tool will be treated as a custom
150command and a shell eval will be used to run the command with the man
151page passed as arguments.
152
153Note about konqueror
154~~~~~~~~~~~~~~~~~~~~
155
156When 'konqueror' is specified in the 'man.viewer' configuration
157variable, we launch 'kfmclient' to try to open the man page on an
158already opened konqueror in a new tab if possible.
159
160For consistency, we also try such a trick if 'man.konqueror.path' is
161set to something like 'A_PATH_TO/konqueror'. That means we will try to
162launch 'A_PATH_TO/kfmclient' instead.
163
164If you really want to use 'konqueror', then you can use something like
165the following:
166
167------------------------------------------------
168[man]
169viewer = konq
170
171[man "konq"]
172cmd = A_PATH_TO/konqueror
173------------------------------------------------
174
Junio C Hamano8b588d52008-03-15 09:48:37175Note about git config --global
176~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177
178Note that all these configuration variables should probably be set
179using the '--global' flag, for example like this:
Junio C Hamano3dac5042007-12-15 08:40:54180
181------------------------------------------------
182$ git config --global help.format web
183$ git config --global web.browser firefox
184------------------------------------------------
185
186as they are probably more user specific than repository specific.
Junio C Hamano35738e82008-01-07 07:55:46187See linkgit:git-config[1] for more information about this.
Junio C Hamano3dac5042007-12-15 08:40:54188
Junio C Hamano58256872007-12-04 08:31:13189GIT
190---
Junio C Hamanof7c042d2008-06-06 22:50:53191Part of the linkgit:git[1] suite