tags:

views:

31

answers:

1

I've got git installed on my mac and either forgot or decided not to install the local docs. On my windows install however, when I use git help command it actually opens the corresponding documentation on kernel.org. Can this be configured for my mac install as well? If so how?

+1  A: 

You'll need to set the help.format variable (git config --global help.format web) or use the -w option with the help command:

help.format

If no command line option is passed, the help.format configuration variable will be checked. The following values are supported for this variable; they make git help behave as their corresponding command line option:

  *   "man" corresponds to -m|--man,

  *   "info" corresponds to -i|--info,

  *   "web" or "html" correspond to -w|--web.

Here's the portion on -w as well:

-w, --web

Display manual page for the command in the web (HTML) format. A web browser will be used for that purpose.

The web browser can be specified using the configuration variable help.browser, or web.browser if the former is not set. If none of these config variables is set, the git web--browse helper script (called by git help) will pick a suitable default. See git- web--browse(1) for more information about this.

I can't test it right now, but I'm fairly sure that on Windows, using the web help actually uses a local copy of the HTML docs (not from kernel.org as you said); this is good because those are the docs that correspond with your version of git, and you won't mistakenly read docs for a different version. Regardless, using -w on OSX 10.6 for me loads local HTML docs as well.

Mark Rushakoff
Hmmm...when I try that I get `fatal: '/usr/local/share/doc/git-doc': not a documentation directory.` Perhaps there is something else required?
Paul Alexander
@Paul: How did you install git? I used fink or MacPorts, and mine redirects to `/opt/local/share/doc/git-core/git-whatever.html` successfully. You may have installed it without local html documentation somehow -- building the docs does have a dependency on AsciiDoc, so that might have had something to do with it.
Mark Rushakoff
If you build from source (with the makefile), you actually have to explicitly request that the documentation be installed. There's a rule for each type of documentation: `install-man`, `install-html`, `install-info`, and `install-pdf`. (`install-doc` just refers to `install-man`). I think they aren't done by default because building the documentation actually takes quite a while - asciidoc isn't the fastest utility in the world.
Jefromi