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