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.

See http://mynameispagewood.com/web-development/osx-mavericks-git-error/

104 out of 141 found this helpful
26 comments
Avatar
Permanently deleted user

This tip totally works!!! Thanks.

1
Avatar
Permanently deleted user

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.

0
Avatar
Permanently deleted user

Great. This worked. Thanks!

0

Hi, 

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?

 

Thanks

0
Avatar
Permanently deleted user

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

0

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

0
Avatar
Permanently deleted user

it works for me too - thx

0
Avatar
Permanently deleted user

Thanks

0
Avatar
Permanently deleted user

thanks!!!

Edited by Permanently deleted user
0
Avatar
Permanently deleted user

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. 

0
Avatar
Permanently deleted user

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

0

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

0
Avatar
Permanently deleted user

Thanks @Rusty. It's the correct solution.

0
Avatar
Permanently deleted user

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/Xcode.app/Contents/Developer
  3. sudo xcodebuild -license
Edited by Permanently deleted user
14
Avatar
Permanently deleted user

This worked after High Sierra upgrade.  Thanks for sharing

Edited by Permanently deleted user
1
Avatar
Permanently deleted user

xcode-select --install

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

0
Avatar
Permanently deleted user

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.

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

After upgrade to 10.13.3 last night I am getting 

Fetch failed: Could not read from remote repository.

Git pull from command line works correctly.

 

I have tried 

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

2 - sudo xcodebuild -license (accepted the license)

3 - Run xcode (it opens correctly)

4 - restart machine

1
Avatar
Permanently deleted user

same error as `Michael Dudley`. tired same steps with no luck MacOS 10.13.3 (17D102)

0
Avatar
Permanently deleted user

switching to native SSH client in prefs worked for me

0
Avatar
Permanently deleted user

Yes that also fixed it for me

0
Avatar
Permanently deleted user

If you have a private repo on a macOS machine, you have to make sure you agree to the license on both devices!

0

Tried executing this command which gave me an error saying "xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance".

 

Hence i just restarted my IntelliJ and git started working as expected.

1

Please sign in to leave a comment.

Have more questions?

Submit a request