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