23

I just updated my MBP to OSX 10.8 and am trying to start a new project with brunch.io which by default uses coffeescript and I prefer javascript so I need to clone the simple js skeleton. So something like this:

brunch new <someprojectname> --skeleton https://github.com/brunch/simple-js-skeleton.git

Which is what I have used previously and it worked fine. But today I am getting the following error:

error: Git clone error: /bin/sh: git: command not found

I really don't know how to fix this...

Jonathan Miller
  • 1,786
  • 1
  • 16
  • 26

5 Answers5

40

You can download Apple's official collection of developer command line utilities (which includes git) by either:

  • Opening Xcode, going to Preferences > Downloads and clicking the install button next to 'Command Line Utilities'
  • Going to developer.apple.com/downloads, and downloading "Xcode 4.4 Command Line Tools for OSX 10.8" from the Xcode 4.4 category
Jamie
  • 3,890
  • 3
  • 26
  • 35
  • I guess the real problem is that Xcode was upgraded (replaced) along the way, so the command-line tools are missing. Thanks! – Gonen Sep 24 '13 at 18:17
4

Check your .bashrc or .bash_profile if the appropiate PATH is set. Did you install git via macports? The update probably dropped the /opt/bin or /opt/local/bin from the PATH.

Femaref
  • 60,705
  • 7
  • 138
  • 176
  • I can't even find .bashrc or .bash_profile. In terminal I type: ls -a and the only thing beginning with .bash is .bash_history... also I'm did a quick check and don't have macports installed. it was awhile ago that I installed git, I don't remember how or when I did actually... – Jonathan Miller Jul 27 '12 at 19:43
  • 3
    This tips works for me. My profile is called `.profile` and it is in the root of my home folder. This is in there: `export PATH="/usr/local/git/bin/:$PATH"`. I did not need to reinstall anything, but make sure you restart Terminal after you have added this. – Blaise Jul 30 '12 at 21:02
3

I got everything working again. Apparently the update to Mountain Lion dropped git altogether. Simply downloading the install package from here and running it has everything working again.

Jonathan Miller
  • 1,786
  • 1
  • 16
  • 26
  • 1
    Couldn't install it after download, got a message that the package was from an unidentified developer and that my security settings only allow installs from Apple Store!!! Just installed Mountain Lion, so I really need to check these security settings!... – PatrickS Jul 29 '12 at 06:24
  • 1
    Go to Prefernces -> Security -> check any sorce instead only App Store – Geralt_Encore Jul 30 '12 at 10:40
  • I don't think it drops git, I think it just removes it from the PATH somehow. Femaref's answer worked for me. – Greg Oct 01 '12 at 01:17
0

YOu have to change your security settings go to System Preferences > Security and Privacy > Change Allow Applications downloaded from --> Anywhere. There is a chance your security settings would be locked in that case press the lock at the bottom left on the pref pane.

manishnath
  • 444
  • 1
  • 3
  • 12
0

Based on this article:

  1. open your ~/.bash_profile, if you use nano it would be : $ sudo nano ~/.bash_profile

  2. add this line to the file: export PATH=$PATH:/usr/local/git/bin/

  3. Save & close the file and type on the terminal: $ source ~/.bash_profile

Anthon
  • 69,918
  • 32
  • 186
  • 246