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