Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Git HTML Help on OSX

Tags:

git

macos

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

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

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

git help --web commit

I get the following error:

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

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!

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

EDIT: 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"

like image 975
GxXc Avatar asked Jan 03 '12 07:01

GxXc


1 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 in Github tutorial soon.

UPDATE:

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

This will create an entry in your .gitconfig like:

[help]
    format = html
    htmlpath = /usr/local/git/share/doc/git-doc
like image 174
erop Avatar answered Oct 13 '22 02:10

erop