how do i get git to show command-line help in windows?

前端 未结 3 1035
攒了一身酷
攒了一身酷 2021-02-04 01:36

How do i get git to show command-line help in windows?

I\'m using msysgit 1.7.4.

It\'s defaulting to open the html help in the browser.

I just want to sh

3条回答
  •  感情败类
    2021-02-04 02:31

    I've just spent some time researching the subject, and these are my conclusions:

    • msysgit ships with .html and .txt documentation, the latter being well suited for reading on the console; however, no option for directly displaying the txt exists. help.format only supports web/man/info

    • there's no way to coax the 'web' format for that purpose - I tried renaming the .txt files to .html and setting my git web.browser to more (together with browser.more.cmd), only to find out that the windows implementation of Git ignores these settings and launches the html file directly (i.e. in the default browser): http://comments.gmane.org/gmane.comp.version-control.msysgit/10798

    • unless you want to install and use cygwin, there's no easy way to use man or info either - you'll need to download a port of the executable, together with its dependencies (groff, etc), configure it, and download the manpages manually

    In the end I resolved for the simplest approach:

    githelp.bat: @more "C:\Program Files\Git\doc\git\html\%1.txt"

    githelpfind.bat: @dir /b "C:\Program Files\Git\doc\git\html\*.txt" | find "%1"

    Usage:

    \> githelpfind prune
    git-prune-packed.txt
    git-prune.txt
    
    \> githelp git-prune
    (blah blah blah)
    

    A little more typing this way, but a functional solution.

提交回复
热议问题