Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Oct 31 '12 at 14:22

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

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)

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

You must log in to answer this question.