Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

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.

View xcodegitup.sh
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.

Owner

Nope, just Xcode. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.