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