Install Git HTML Help on OSX

I tried installing the Git HTML help pages on OSX according to the instructions given in the following links:

But when I get to the final stage of verification, which includes starting up:

git help --web commit 

I get the following error:

 fatal: '/usr/local/git/share/doc/git-doc': not a documentation directory 

I checked that the folder / usr / local / git / share / doc / git-doc was created when git clone was run and that it is full of files that look like Git documentation files.

Can someone tell me what I don't see? Thanks!

The following is a short list of some files created in the git -doc folder:

  • exec_cmd.c
  • exec_cmd.h
  • fast import.c
  • fetch-pack.h
  • Fixup built-in functions
  • 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

EDIT: Just looked at the results of Git clone and found this warning, not sure if it matters: "The remote html branch was not found in the original origin, HEAD is used instead"

+8
git macos
source share
2 answers

Change clone command address from

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

to

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

Hope this will be changed soon in the Github tutorial.

UPDATE:

If you are one of those who consider it sufficient to distribute the Apple Git that ships 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 

This will create an entry in your .gitconfig, for example:

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

Code ( builtin/help.c ):

 static void get_html_page_path(struct strbuf *page_path, const char *page) { struct stat st; const char *html_path = system_path(GIT_HTML_PATH); /* Check that we have a git documentation directory. */ if (stat(mkpath("%s/git.html", html_path), &st) || !S_ISREG(st.st_mode)) die("'%s': not a documentation directory.", html_path); strbuf_init(page_path, 0); strbuf_addf(page_path, "%s/%s.html", html_path, page); } 

Thus, there may be a problem with the GIT_HTML_PATH environment GIT_HTML_PATH (as in the old problem ), or you do not have any git.html in the help directory at the destination.

0
source share

All Articles