2

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'?

3

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.

6

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 Aug 16 '14 at 17:12
4

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 should be the marked answer. – xarlymg89 Sep 4 '18 at 21:07
0

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 Aug 12 '11 at 7:01
  • I just installed XCode 4 two days ago, it cost me nothing. – zellio Aug 12 '11 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 Aug 12 '11 at 7:11
  • @Mimisbrunnr where did you download it? – chefnelone Aug 12 '11 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 Aug 12 '11 at 7:26
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.