Installing git on OSX 10.8 without Xcode
Note that this is a plain copy of a previous answer of mine on superuser.com.

Here's a way to install git on Mac OS X without XCode.

Git's official web site provides an installer : http://git-scm.com/download/mac

After installing git, you also have to add its directory to your path :

echo "PATH=/usr/local/git/bin:\$PATH" &gt;&gt; ~/.bash_profile
source ~/.bash_profile


Adding the directory to the path will prevent Mac OS X from aksing you to install XCode each time you type git in the terminal.

Credits goes to Bobby Allen and to GoZoner's answer on SO.