Categories
Coding OSX Technology

How to install Git without having to install Xcode on MacOSX

Today I re-installed one of my Mac’s with the latest version of OSX (my laptop has been using Mavericks for a while so I thought I’d better upgrade my family iMac too!)

Anyway, annoyingly, if you download Git for MacOSX from the official Git website (http://git-scm.com/) and install it on your Mac,  you’ll notice that unless you have XCode installed, OSX will keep pestering you to install XCode!

Not for long… Download and install the latest version from the Git website and then simply open up your terminal and run the following command:

echo "PATH=/usr/local/git/bin:\$PATH" >> ~/.bash_profile

You’ll now have added the new ‘git’ binary path into your .bash_profile of which will precede Apples git stub (will bypass the XCode installation notice and need to install XCode altogether).

After typing the above command, simple close and re-open the terminal, or to re-load your bash profile without closing and re-opening, simply run:

source ~/.bash_profile

Test it works by checking the version of git like so:

git --version

Enjoy! – No need to bloat out your Mac anymore if you’re not using XCode 🙂

2 replies on “How to install Git without having to install Xcode on MacOSX”