How to open git local documentation files by git command?

Working with git branch I press this git command git branch --help , and it open a nice doc file from my computer where git was installed. Like this —

enter image description here

and scroll down I also found this nice doc as well

enter image description here

In the URL if I paste this file:///C:/Program%20Files/Git/mingw64/share/doc/git-doc/ then show this almost all doc about git. Like this —

enter image description here

My question is, if git branch --help show the branch-related doc then how to open all doc section by git command, which I share by screenshot number 3. Can anybody know?


Solution 1:

There's no way to open the listing of all HTML pages in the browser like this. The reason is that the --help functionality can display in various formats, only one of which is HTML.

The default behavior on many systems is to display a manual page, and typically all manual pages from all programs on the system are stored in the same directory. Therefore, there's no place to show only the Git docs in general, and as such, Git doesn't provide an option to do this.

If you just want to see a list of all the commands, git help -a will do that, though, and then you can run git help COMMAND. git help --help will show you all of the available options you can use.