How does a person find git subcommand commands?

On my Linux system, I can do "man git log" (note the space), and this will show me the manpage for git-log (1) (with dashes), as expected.

On my MacOSX "man git log" only the man page for git (1) is displayed.

How does a linux person know that the two arguments "git" and "log" must be combined to find the "git -log" manpage? How to get the same result in OSX?

+5
source share
1 answer

This is a feature of the specific man implementation used on many Linux systems. Referring to the documentation (for man ), this is mentioned in the description of the --no-subpages :

--no-subpages

By default, man will try to interpret pairs of manual page names specified on the command line as being equivalent to a single name on the manual page containing a hyphen or underscore. This supports the general scheme of programs that implement the number of subcommands, allowing them to provide manual pages for each that can be accessed using the same syntax that would be used to invoke the subcommands themselves.

Other man implementations can do different things. For example (not well documented , but there if you study it), a quick check of man git status on OSX El Capitan shows that she is trying to find a man page for the status. However, man git-status gives a man git-status page.

+7
source

Source: https://habr.com/ru/post/1232132/


All Articles