git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Why are there multiple ways to get the manual in Git?

From
Christian Couder <christian.couder@gmail.com>
Date
Sep 17, 2016, 19:21 UTC
Message-ID
<CAP8UFD3TPeqY_O-Rc0rvLMO=XVxRMTMwq3gftpnx5LJh6WOZ1A@mail.gmail.com>
In-Reply-To
<20160917183919.GJ20666@paksenarrion.iveqy.com>
On Sat, Sep 17, 2016 at 8:39 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:
Show 6 quoted lines
> On Sat, Sep 17, 2016 at 01:47:52PM -0400, Andrew Johnson wrote:
>> $ git help <verb>
>> $ git <verb> --help
>> $ man git-<verb>
>>
>> I tested all three to confirm they were equivalent.
Maybe it will be easier to understand if you try:
$ git help help
or
$ git help --help
or
$ man git-help
:-)
> While I'm not able to answer your question, I can shred a little light
> about them not being equal. For example using a windows machine
>
> $ man git <verb>
(It should be "git-<verb>" above.)
Show 5 quoted lines
> does not work and
>
> $ git help <verb>
>
> opens a webbrowser instead of a man page.

Yeah, it is one of the reasons. There are systems where "man" is not the standard ways to get help, and text on the command line is not the prefered format for help content. So the "git help" command has different default depending on the OS to better suit user expectations on each OS. This way people can just be teached to use "git help" and that will do something sensible everywhere.

> Using a unix system I would
> however assume that
>
> $ man git <verb>
(Again it should be "git-<verb>" above.)
> would work since it's the standard way of getting help on those systems.
Yeah, so we need that to work to make people happy on unix systems.

Another reason is that "git help" provides more configurability and more features like its -a and -g options. It could provide even more in the future, like options to search in the documentation.

Previous: Philip OakleyNext: Jakub Narębski
Message 4 of 8 in “Why are there multiple ways to get the manual in Git?”
  1. Andrew JohnsonSep 17, 2016
  2. Fredrik GustafssonSep 17, 2016
  3. Philip OakleySep 17, 2016
  4. Christian CouderSep 17, 2016
  5. Jakub NarębskiSep 18, 2016
  6. Philip OakleySep 18, 2016
  7. Junio C HamanoSep 19, 2016
  8. Philip OakleySep 19, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.