Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I installed Git via homebrew, on OSX 10.8, with an already existing version of Git. The new version wouldn't show up, so I renamed the old git files (git, gitk etc...)in /usr/bin , to *-old. Now the new git shows up, but the man files still belong to the old git version.

The new git installed via homebrew is located in /usr/local/bin/git and its man files are in /usr/local/Cellar/ for some reason. Some of the other packages I have installed via homebrew such as autoconf seem to have been picked up by man while others have not, such as apple-gcc42, and git.

Question: How do I override the old git man files and replace them with the new ones?

Question 2: are there any other dependencies OSX that I should be aware of that could be broken by changing the file like this?

share|improve this question
add comment

1 Answer

First, make sure /usr/local/bin appears before /usr/bin in your PATH variable.

$ echo $PATH

If not, add the following to your .bash_profile (you probably don't need to, I think homebrew does this when you install it):

PATH="/usr/local/bin:$PATH"

Also in .bash_profile, add /usr/local/Cellar to MANPATH:

MANPATH="/usr/local/Cellar:$MANPATH"

(Note: it may be a longer path you need to add, like /usr/local/Cellar/git/1.8/share/man. Check which directory actually contains the man1 directory containing the various git man pages.)


If you still need to see, e.g., an old git man page, you can pass a full path to the man command:

$ man git  # Finds page under /usr/local/Cellar
$ man /usr/share/man/man1/git.1   # Original git man page
share|improve this answer
    
It works, I like it very much. I just move the /usr/local/bin to the begin of the $PATH, the man pages change automatically, Mac OS X mountain lion. –  Charles Sep 26 '13 at 16:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.