在OSX上安装Git HTML帮助 [英] Installing Git HTML Help on OSX

查看:60
本文介绍了在OSX上安装Git HTML帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've tried to install the Git HTML help pages on OSX according to the instructions provided by the following links:

但是当我进入涉及运行的最后验证步骤时:

But when I get to the final verification step that involves running:

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 documentation的文件文件.

I've verified that the folder, /usr/local/git/share/doc/git-doc was in fact created when I ran "git clone", and that it is full of files that appear to be git documentation files.

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

Can someone let me know what I am missing? Thanks!

以下是在git-doc文件夹中创建的一些文件的简短列表:

Here is a short list of some of the files that were created in the git-doc folder:

  • exec_cmd.c
  • exec_cmd.h
  • fast-import.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"

Just looked over the git clone results and found this warning, not sure if it makes a difference: "Remote branch html not found in upstream origin, using HEAD instead"

推荐答案

$ 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教程中更改.

Hope this will be changed in Github tutorial soon.

更新:

如果您认为Xcode 4提供了Apple Git发行版就足够了:

If you are one of those who thinks it’s enough to have Apple Git distribution supplied with Xcode 4:

# 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中创建一个条目,例如:

This will create an entry in your .gitconfig like:

[help]
    format = html
    htmlpath = /usr/local/git/share/doc/git-doc

这篇关于在OSX上安装Git HTML帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆