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