我尝试根据以下链接提供的说明在OSX上安装Git HTML帮助页面:

  • http://help.github.com/install-git-html-help/
  • http://www.railsatwork.com/2010/12/installing-git-html-documentation-on.html

  • 但是当我进入涉及运行的最后验证步骤时:
    git help --web commit
    

    我收到以下错误:
    fatal: '/usr/local/git/share/doc/git-doc': not a documentation directory
    

    我已经验证了/usr/local/git/share/doc/git-doc文件夹实际上是在我运行“git clone”时创建的,并且其中充满了看似git文档文件的文件。

    有人可以让我知道我在想什么吗?谢谢!

    以下是在git-doc文件夹中创建的一些文件的简短列表:
  • exec_cmd.c
  • exec_cmd.h
  • 快速导入.c
  • fetch-pack.h
  • fixup-builtins
  • fmt-merge-msg.h
  • fsck.c
  • fsck.h
  • generate-cmdlist.sh
  • gettext.c
  • gettext.h
  • git-add--interactive.perl
  • git-am.sh
  • git-archimport.perl
  • git-bisect.sh
  • git-compat-util.h
  • git-cvsexportcommit.perl
  • git-cvsimport.perl
  • git-cvsserver.perl
  • git-difftool--helper.sh
  • git-difftool.perl
  • git-filter-branch.sh

  • 编辑:
    只是查看了git clone的结果并发现了此警告,不确定是否会有所不同:
    “在上游来源中找不到远程分支html,而使用HEAD”

    最佳答案

    从更改克隆命令地址

    $ sudo git clone git://git.kernel.org/pub/scm/git/git.git git-doc --branch html
    


    $ sudo git clone git://git.kernel.org/pub/scm/git/git-htmldocs.git git-doc
    

    希望很快在Github教程中对此进行更改。

    更新:

    如果您认为Xcode 4随附Apple Git发行版就足够了:
    # create directory to keep Git documentation html-files
    $ sudo mkdir -p /usr/local/git/share/doc # or whatever directory you choose
    
    # change to that directory
    $ cd /usr/local/git/share/doc
    
    # clone repo with documentation
    $ sudo git clone git://git.kernel.org/pub/scm/git/git-htmldocs.git git-doc
    
    # point your Git explicitly to a new documentation directory
    $ git config --global help.htmlpath /usr/local/git/share/doc/git-doc
    
    # tell Git to use html-formatted help by default
    $ git config --global help.format html
    

    这将在您的.gitconfig中创建一个条目,如下所示:
    [help]
        format = html
        htmlpath = /usr/local/git/share/doc/git-doc
    

    关于macos - 在OSX上安装Git HTML帮助,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8709383/

    10-14 13:11
    查看更多