0

A friend of mine need to clone a git repo, but on his machine is xcode not installed and when he tries to use git his Macbook says

The command git requires the command line developer tools, do you want to install them?

The picture is in German.

git

So is it possible to use git on OS X without Xcode?

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
Knerd
  • 1,892
  • 3
  • 28
  • 55

2 Answers2

2

Yes. Instead of using the built-in git command:

  • Install Homebrew if you haven't already:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  • Run brew update && brew install git

  • Restart Terminal (or close the current tab and open a new one)


Before you do this:

$ git --version
git version 1.9.3 (Apple Git-50)

After you do this:

$ git --version
git version 2.2.1
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
1

How about using SourceTree.app?

http://www.sourcetreeapp.com/

SourceTree.app has also git binary.

$ SourceTree.app/Contents/Resources/git_local/bin/git --version
git version 2.2.1

EDIT

he has github for mac installed and git, but it shows this message anyway :(

I guess he didn't set PATH env, so that git was /usr/bin/git. He should use /Applications/GitHub.app/Contents/Resources/git/bin/git instead of git, or set PATH env.

Kazuki Sakamoto
  • 13,929
  • 2
  • 34
  • 96
  • I accepted, your answer, because Sourcetree worked and we gonna try the `PATH` thing :) – Knerd Dec 20 '14 at 00:15