git on command line no longer works on El Capitan

13

1

Having just installed OS X 10.11 last night, I was surprised to see that my Bash terminal did the following:

$ git
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.

Previous version of XCode did not transfer to the new OS. I tried a fresh install of Git, but still had the same XCode failure in Bash.

Is there good reason for this?

Alex

Posted 2015-10-01T12:17:54.453

Reputation: 263

When that command-line message happens, you should also see a GUI dialog offering to install the latest version of the Xcode command-line tools. Did that not happen? – Spiff – 2015-10-01T14:52:32.460

Yeah once I installed XCode it worked... I was more wondering why git now has a dependency on the Apple Dev Tools...? – Alex – 2015-10-01T15:23:35.987

Answers

21

For me, this was a solution:

xcode-select --install

After the installation, git started to work again.

Michal

Posted 2015-10-01T12:17:54.453

Reputation: 326

Good call thanks. Will mark as correct although I installed XCode and this fixed it too. – Alex – 2015-10-02T08:05:41.517

Thanks :) This is my first answer on StackExchange, so it will help me to earn reputation. – Michal – 2015-10-02T08:36:22.477

1

Faced this after upgrading to El-Capitan

xcode-select --install 

didn't work for me even after 'Finding Software' and Downloading. I don't have Xcode.app installed (Didn't want to install it) so i fixed it by downloading Command Line Tools from https://developer.apple.com/downloads/ (requires Apple SignIn) and installed it manually.

After installation i was able to run git commands again

William M

Posted 2015-10-01T12:17:54.453

Reputation: 11

I believe that the command xcode-select --install does exactly the same thing - install the Command Line Tools. You can read this in the command's help: xcode-select --help. I think it does not require Xcode.app to be installed. – Michal – 2016-01-14T13:24:39.127