Installing the Git man pages locally

(NOTE: The following applies to git under Mac OS X 10.6.2 (Snow Leopard). I can’t make any guarantees for other versions, but you still may find the article helpful.)

So, today I spent an insane amount of time trying to get my git install completely up-to-date, which meant installing the documentation locally on my machine. Sounds fairly straightforward, but unfortunately it was not.

To give you some context, this is the how-to article I was following, from GitHub. Git installed with no problems at all, but I ran into problems when building either of the following make targets:

make man
make install-doc

At this stage, make would freeze whenever it reached an xmlto command (xmlto is a dependency for building the git documentation, I installed it with MacPorts). This is where it got stuck for me:

me@localhost$ make man
make -C Documentation man
    SUBDIR ../
make[2]: `GIT-VERSION-FILE' is up to date.
    XMLTO git-add.1

Blinking cursor. No action. Bad.

So I found this really helpful post about xmlto issues, but it did not help me. From the post:

…Turns out, the latest version of xmlto uses a cp -a command which is a no-go on OSX.

The fix is simple enough, on line 11 of format/docbook/man, change “cp -a -- ...” to “cp -- ...” and you’re done.

My xmlto_directory/format/docbook/man file contained this at line 11

cp -R -P -p -- * "$OUTPUT_DIR" 2>/dev/null

So cp -a wasn’t my problem.

I ended up just downloading the pre-built man pages. You can find them here (just navigate to the version of git you’re using). Once I had the man pages, I followed these steps:

  1. Extracted the package
  2. Copied the man1, man5 and man7 directories to /usr/local/man
  3. Edited my man.conf file (located at /etc/man.conf) to include the path /usr/local/man
    • Find the lines beginning with MANPATH
    • Add a new line MANPATH /usr/local/man if it doesn’t already exist

I could now access all of the git man pages. Yay! (*cough* 12:30 AM *cough*) You can test it with man git or man git-log, etc.

This entry was posted in Computing, Git, Programming. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting