public
Created

Xcode ships with an outdated version of Git. If you're using a newer Git in "usr/local/bin" (such as a Homebrew install) and want Xcode to use it, too, then this is for you. This will have to be run after each and every update of Xcode.

  • Download Gist
xcodegitup.sh
Shell
1 2 3 4 5 6 7 8
#!/bin/sh
 
cd /Applications/Xcode.app/Contents/Developer/usr/bin
/Applications/Xcode.app/Contents/Developer/usr/bin/git --version
sudo mv git git_old
sudo ln -s /usr/local/bin/git git
echo "...has been changed to..."
/Applications/Xcode.app/Contents/Developer/usr/bin/git --version

Hmm.. Something seems to be a bit off:

git version 1.7.12.4 (Apple Git-37)
Password:
...has been changed to...
git version 1.8.2
dotnetCarpenter@mini ~/Projects/bash master$ git --version
git version 1.7.12.4 (Apple Git-37)

Sorry, my bad. I thought your script changed git globally to use a newer version and not just xcode.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.