On Mac. I have installed 'brew' using terminal, now I tried to install 'git' with the command: 'brew install git'. But terminal says "Now install Xcode: http://developer.Apple.com/technologies/xcode.HTML"

So I go to this page, but I found that I have to pay (at least) 99$/year to get 'xcode'.

Is there a free version of xcode to download from Apple site? If not, is there a way to install 'git' without 'xcode'?

5 Answers 5


Xcode 3.2.6 is free. It works on OS X Snow Leopard(10.6) or later. You have to be a registered Apple Developer to download it. It is also free to register.

Xcode 4.1 is also free. But it works only OS X Lion(10.7). You can download Xcode 4.1 from Mac App Store.

If you are using OS X Lion, you can use Xcode 4.1 or Xcode 3.2.6 for free.

  • 3
    None of the links work and the original question was "How to install git on Mac WITHOUT XCode?" which this does not answer. Commented Apr 28, 2021 at 16:28
  • 3
    This is not answering the question
    – MingMan
    Commented Jan 13, 2022 at 14:32
  • 1
    XCode also takes a lot of drive space -- 35 GB on my mac. It must be possible to install git without incurring the storage costs or registering with Apple.
    – Tom
    Commented Jul 6, 2022 at 4:00

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.

  • 4
    This should be the marked answer.
    – xarlymg89
    Commented Sep 4, 2018 at 21:07
  • This should be the marked answer. Commented Oct 19, 2020 at 3:34
  • Conda also comes bundles git.
    – Maxim
    Commented Apr 15, 2021 at 15:08

To answer the question as posed: get the OSX Installer for Git. I've used it several times. Works just fine, and doesn't require Xcode.

  • This should be the right answer. No need to grab the full xcode package for that
    – Daniel San
    Commented Aug 16, 2014 at 17:12
  • These haven't been updated since 2013. The other answer contains more official and current links. Commented Sep 22, 2020 at 9:26

Brew wants to download source and compile it locally. That requires build tools, and where you get them is with the Apple developer software. So it wants Xcode.

You can download a pre-compiled and ready-to-install version of git here instead.


Sign up to be an Apple Developer, XCode is free from them through the Apple Developer Connection.

Download Xcode 4 for Free

Xcode 4 is a free download for all members of the iOS and Mac Developer Programs. Log in to your account to begin the download.

  • I believe this is only true for the 3.x version (but not sure if they are still offerring this as a free download). XCode 4.0 can be purchased from the Mac AppStore for about $5 or can be downloaded through the $99 developer program.
    – gyurisc
    Commented Aug 12, 2011 at 7:01
  • I just installed XCode 4 two days ago, it cost me nothing.
    – zellio
    Commented Aug 12, 2011 at 7:05
  • the only link I see to enroll as developer is this one: developer.apple.com/programs/mac and as you can see it has a 99$/year fee. Where is the link to sign up free though?
    – chefnelone
    Commented Aug 12, 2011 at 7:11
  • @Mimisbrunnr where did you download it?
    – chefnelone
    Commented Aug 12, 2011 at 7:14
  • version 4 comes from the new app store program that comes with OS X 10.7.x versions 3.x.x comes from their site
    – zellio
    Commented Aug 12, 2011 at 7:26

You must log in to answer this question.

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