Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-bash: git: command not found in Xcode 4 in lion osx

Through Xcode 4.3 ->file -> source control -> repositories -> clone repository, I've cloned a repository from codesion.com. but when I go a git init or git add, the error -bash: git: command not found shows up. Now, Xcode 4.3 comes with the git installed, so what should I do to get this working?

Any help on this would be great.

Thanks in advance.

like image 378
inforeqd Avatar asked Mar 30 '12 01:03

inforeqd


2 Answers

There is another option if you're not experienced with UNIX or you just don't want to mess with the system variables from the terminal. I had the same problem, and after some reading on SO and apple developer pages I've decided to install the Command Line Tools for Xcode. That solved the problem.

As the Xcode IDE from some 4.x version is an .app package and everything is stored inside that package, they have added the possibility to separately install the command line tools so that you have the command line tools inside the usr/bin/ path.

You can install the command line tools (as well as some other tools and documentation) from the Downloads tab of the Preferences window in Xcode (I have version 4.3), or from the apple developer website.

like image 122
lgdev Avatar answered Sep 30 '22 12:09

lgdev


It's a path issue. See this question for the answer:

How to move GCC in osx from xcode to /usr/bin

(P.S. The question is different, but the answer the same.)

like image 34
rob Avatar answered Sep 30 '22 11:09

rob