Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've just completed a fresh install of Mavericks. Then I went to git-scm.com and downloaded the Mac installer and installed Git from that.

Now whenever I go into the terminal and type git I get this:

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', 
requesting install. Choose an option in the dialog to download the command line 
developer tools.

I also this dialog:

enter image description here

The git installer installed git into /usr/local/git/bin and I've added this to my PATH but still no dice.

What am I doing wrong here? I don't want to install xcode just so I can use git.

share|improve this question

2 Answers 2

up vote 27 down vote accepted

Just download the original git package. The installer will install git under /usr/local/git (you need to deactivate security options to run the installer).

There is a preinstalled git wrapper in /usr/bin used by Xcode which does not work without installing Xcode. You need to run /usr/local/git/bin/git explicit or change the PATH variable to contain /usr/local/git/bin before /usr/bin!

Create/edit your ~/.profile with the following:

PATH=/usr/local/git/bin:$PATH
export PATH
share|improve this answer
    
Is there a way to remove that wrapper from xcode? –  Jan Hančič Oct 27 '13 at 19:33
    
@JanHančič: Yes, sudo rm /usr/bin/git, but not recommended! –  Arne Burmeister Oct 27 '13 at 19:36
2  
Try it with ~/.profile instead and relaunch terminal app –  Arne Burmeister Oct 27 '13 at 19:56
1  
This works now yes. I guess my .bashrc doesn't get picked up somehow. Thanks! –  Jan Hančič Oct 27 '13 at 20:01
1  
For me worked the above but in ~/.bash_profile –  Chux Dec 27 '13 at 23:25

Just set an alias so when you call the git command it calls the right one instead of the wrapper...

alias git="/usr/local/git/bin/git" 

Mac-mini:/$ git -version
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

Mac-mini:/$ alias git="/usr/local/git/bin/git"

Mac-mini:/$ git -version
Unknown option: -version
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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