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 originally had git installed via Homebrew, but on this machine I forgot to setup the bash completion. So when I attempted to download the git source I accidentally installed a second version of git (1.7.3) which overrode 1.8.0.

Obviously I should've been more careful. So, I attempted to uninstall that version of git in hopes the version installed with Homebrew would just work, but it's not.

So question is, how do I uninstall all versions of git, and then re-install the latest version with Homebrew?

I tried

rm -rf /usr/local/bin/git
rm /etc/paths.d/git

But after the first line, I just got: No such file or directory

I also uninstalled git through brew and then reinstalled it, but when I do:

git --version

I get nothing. :/

Any suggestions?

share|improve this question

migrated from stackoverflow.com Oct 31 '12 at 14:22

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

Have you checked your $PATH to see if it's correct set? Remember /usr/local/bin should come before /usr/bin when using Homebrew (or whatever path you have set for your installation of Homebrew.)

Example: (this should be in your .profile file, or .zprofile if you use Zsh)

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

This way, the Git version installed via Homebrew should be detected first before any system installations.

But we can easily debug this, if you type the following command into your shell and post the output:

$ echo $PATH

Good luck!

share|improve this answer
    
Perfect, worked like a charm. After checking and setting my $PATH I was able to successfully reinstall git and get rid of all other versions. –  adrianrodriguez Oct 31 '12 at 14:05

Your Answer

 
discard

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