Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Git via Homebrew doesn't switch default to the Homebrew one

I have OS X Lion, and it comes with Git version 1.7.7.5 (Apple Git-26).

I then used Homebrew to install Git 1.7.10.1, and everything went fine.

But then when I did git --version, it still showed Git version 1.7.7.5.

Does anyone have this issue?

like image 859
sivabudh Avatar asked May 11 '12 04:05

sivabudh


People also ask

Is git installed by default on Mac?

Git can be installed on the most common operating systems like Windows, Mac, and Linux. In fact, Git comes installed by default on most Mac and Linux machines!

How do I know if git is installed or not?

You can check whether Git is installed and what version you are using by opening up a terminal window in Linux or Mac, or a command prompt window in Windows, and typing the following command: git --version.


1 Answers

Try changing your path order on your .bashrc and put /usr/local/bin (which Brew uses) before /usr/bin (which has the default git). It should do the trick.

like image 117
Pedro Nascimento Avatar answered Sep 23 '22 06:09

Pedro Nascimento