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