I installed Git 1.7.7.4 by homebrew, but Apple integrated Git into Xcode since version 4.
So in my computer, the default Git version is 1.7.5.4 which it’s built-in Xcode 4.
I wonder if there’s a way that let me use new version by default and would impact Xcode?
I tried add the path to $PATH:
export PATH=/usr/local/Cellar:$PATH
BTW, I’m using zsh.
Updated:
Thanks for @birryree’s help, I’m using a wrong path, it should be /usr/local/bin, because of homebrew will use /usr/local/Cellar for storage, and use symlink to make sure all the packages are available on /usr/local/bin.
According to my experience with my problems, have a check at 10449374 and 13177203, this will help you:
change into the Xcode directory:
cd /Applications/Xcode.app/Contents/Developer/usr/binrename the Xcode’s git like this:
sudo mv ./git ./git-xcode-usr-binlink my own git which is installed through homebrew:
sudo ln -s /usr/local/bin/git ./gitAnd you should do the same thing with
/usr/bin/git:This will acctually link
/usr/local/Cellar/git/1.8.0/bin/git(because I’m use git 1.8.0 at the present)