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