Mac OSX: can't start Git after updating Mac OS/XCode

The IDE is giving an error message that it "can't start git: /usr/bin/git", however the path is correct, and it was working before. idea.log contains the following error: ''Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo''


Solution: in terminal, run 'sudo xcodebuild -license' and then agree to the terms.



I tried the proposed solution and got the following error:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Here is what you need to do:

  1. Download Xcode through the AppStore, if you don't have it.
  2. sudo xcode-select -s /Applications/
  3. sudo xcodebuild -license
Edited by Dan

This worked after High Sierra upgrade.  Thanks for sharing

Edited by Pshepker


Thanks for the tip. It works but now whenever I'm in a git directory, all my CLI est extremely slow.

Even a simple 'return' with no command takes ~14seconds. I can't even see me type in real time.

Any reason for this?




The solution works for me after installing Xcode with Sierra 10.12.5. Thank you for the tip!


xcode-select --install

This worked for me after getting the same error as @Dan


This tip totally works!!! Thanks.


This works for me with the recent update of MacOS to 10.9.5 and also of XCode to Version 6.0.1 (the update that includes iOS8 functionality.) I do all my development work in a standard user account, not in an administrative account. Running the above sudo command as an ordinary user did require the administrator password. After that, the license agreement could be agreed to just fine. That in turn allowed me to run my command line software builds. I think seeing this message is a sign that the command line tools parts of XCode have been updated.


Another simple way to install these tools is simply to try to run one of them. If it’s not installed, OS X will give you a prompt that asks if you want to install it. If you agree, it does it quickly and easily!

Send from: VigRx Plus


Thanks for the help. It fixed the problem with the phpstorm came with an error message after installing Xcode from apple, where I had to accept the licence aggrements before running git



Edited by Mevlüt Özdemir

Thanks @Rusty. It's the correct solution.


After updating xcode I also had a warning about missing git on mac.

For some reason git 's path was in /usr/local/bin folder in the initial settings so I changed it to /usr/bin. Weird


I just started Xcode after downloading it from the app store. Then the error message was gone.


for me i first executed

1 - sudo xcode-select -r (resets xcode-select path)

2 - sudo xcodebuild -license (accepted the license)


now all works fine.


This fixed the issue for me too but now I am not able to find any of my projects files when I open the project in Intelli J. All the files that were tracked by Git are not getting displayed. Please help... This is a showstopper issue for my team. 


Please sign in to leave a comment.

Have more questions?

Submit a request