11

I'd like to setup my dev environment on my girlfriend's iMac, but she's not cool with me wasting 3GB of space, which is what Xcode takes up. She also doesn't want to/can't upgrade past 10.8 because then Photoshop won't work, or some nonsense.

How can I get git on OSX 10.8 without Xcode. I somehow doubt that it's impossible to run a few megabytes of git without 3GB of Xcode.

7

There is a binary installer that you can download. See also the Getting Started - Installing Git of the git website:

There are several ways to install Git on a Mac. The easiest is probably to install the Xcode Command Line Tools. On Mavericks (10.9) or above you can do this simply by trying to run git from the Terminal the very first time. If you don’t have it installed already, it will prompt you to install it.

If you want a more up to date version, you can also install it via a binary installer. An OSX Git installer is maintained and available for download at the Git website, at http://git-scm.com/download/mac.

However, as @denis points out, as of July 2017, the binaries on the download page of the Git website are for 10.9 or newer. If you look at where the binary files are actually hosted, on SourceForge, there is an a FAQ about which version of the binary installer to download if you have an older version of Mac OS X/macOS:

Which version should I download?

If you are running:

  • 10.6 Snow Leopard: git-*-snow-leopard
  • 10.7 Lion: git-*-snow-leopard
  • 10.8 Mountain Lion: git-*-snow-leopard
  • 10.9 Mavericks: git-*-mavericks
  • 10.10 Yosemite: git-*-mavericks
  • 10.11 Yosemite [sic]: git-*-mavericks

So for 10.8, you'll want to download any binary installer that ends with the name -snow-leopard. There are several such binary installers, but the one with the most recent version of Git is git-2.3.5-intel-universal-snow-leopard.dmg. Here is a direct download link for it (23.1 MB): https://sourceforge.net/projects/git-osx-installer/files/git-2.3.5-intel-universal-mavericks.dmg/download

  • In July 2017, that binary installer starts downloading git-2.13.1-intel-universal-mavericks.dmg -- 10.9 not 10.8. The FAQ under sourceforge.net/projects/git-osx-installer/files says "10.8 Mountain Lion: git-*-snow-leopard", of which the newest I see is git-2.3.5 from 2015: hellwithit. – denis Jul 12 '17 at 14:36
6

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" >> ~/.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.

  • This! Must add to path (at least for Sierra) no mention in the readme or on the website that I could see. – Melbourne2991 Jan 10 '17 at 20:30
2

First of all you can download git directly, as Adam recommends.

As alternative to command line git tool you may want GUI app. I recommend Atlassian SourceTree. This is really nice and powerful Git/Mercurial client. I tried many GUI applications and only SourceTree satisfied me. Application package already has builtin Git and Mercurial.

At last, you may download Apple command line tools without XCode from Apple developer portal. If you are not developer yet, you should register in portal (it's easy and free).

0
  1. Download and install GIT: http://git-scm.com/
  2. Add this to your .bash_profile file:

    export PATH=/usr/local/git/bin:$PATH

  3. Open a new terminal

Content based on this awesome tutorial:

http://blog.bobbyallen.me/2014/03/07/how-to-install-git-without-having-to-install-xcode-on-macosx/

  • 2
    Please post the content of your link. Links vaporize and your post becomes useless. – fd0 Aug 9 '18 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .