OSX Mavericks and Git Error

By Page Wood November 01, 2013

The software project that I have been working on for the past few months is being built in Laravel 4. With the new edition of Laravel 4, bundles are now being built as packages which are pulled into the project via Composer. What’s that mean? It’s like building chunks of the software into plugins that can be re-used for other projects… Nifty.

I do all of my local dev work using MAMP on Mac OSX, and we use GitHub for version control. Periodically, I have to crack open Terminal and update composer to pull in the latest versions of our Laravel Packages. Being that I’m the Front-End guy on the team, I don’t use Windows like the rest of the crew… So when something goes wrong with Git and OSX, I’m typically left to my own devices and some Google Searches.

The other day I updated my Mac to the new OSX Mavericks, which is an awesome free upgrade (thanks Apple)! Unfortunately, this upgrade did cause a few odd things to happen with my mac. First, I had to re-install Java to open any of my Creative Suite Applications. Next, my Composer updates suddenly stopped working.

When I went to update the Vendor folder with all of the packages in the local Dev environment, I ran into an issue. I ran the usual, php composer.phar install command after dumping the vendor folder and composer.lock folder, only to face a big red error. Man, those red errors are scary, especially for someone who just started learning to use command line a couple of months ago.

Git Error X-Code

That error didn’t make much sense to me, except that Git was apparently not found. First I tried to run my install script in a different way: php phar.composer install --prefer-dist
compliments of this thread. No luck.

I looked at the error a bit more…

β€œAgreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.”

– What?

Ah! Ok, X-code was obviously re-installed with OSX Mavericks. So the answer to this issue is simple. I simply had to run:

sudo xcodebuild -license

This allowed me to view the X-code licence, and then agree to the terms. Voila, that’s it. Everything worked just fine after that.

I’ve since sent this quick fix to my dev friends using GitHub and the Mac. Hope this helps someone else out there!


38 Comments

  1. C
    C

    Thanks for the tip, worked like a champ. That was a pretty cryptic one.
    P.S. Great location to be a developer πŸ™‚

    Reply
    • Page Wood
      Page Wood

      Glad to hear it helped someone else out! And yes, the North Shore is like a dream πŸ™‚

      Reply
  2. Olivier
    Olivier

    Thanks a lot !

    Reply
  3. Jen
    Jen

    This worked for me! Thanks so much!

    Reply
  4. Des
    Des

    Thanks for the tip! There should be something telling you to run that command. So inconvenient.

    Reply
  5. Victor Aldabalde
    Victor Aldabalde

    Thanks a lot, man!

    Reply
  6. Jonathan Beech
    Jonathan Beech

    Worked for me, thank you for that!

    Reply
  7. Andrew
    Andrew

    Worked great! Thank you.

    Reply
  8. Jaco Pretorius
    Jaco Pretorius

    Works perfectly, thanks!

    Reply
  9. Joe Lance
    Joe Lance

    Thanks so much for posting this. Was truly puzzling to this n00b.

    Reply
  10. Sandy
    Sandy

    Thank you very much!

    Reply
  11. Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. | Hanoseok's Blog
    Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. | Hanoseok's Blog
    Reply
  12. hanoseok
    hanoseok

    Thanks, It works for me.

    Reply
  13. Jason Ellis
    Jason Ellis

    Thanks a lot man! Don’t know if I would’ve ever figured this one out on my own.

    Reply
  14. Carlos Carvajal
    Carlos Carvajal

    Thanks, It works!!!!

    Reply
  15. Katherine
    Katherine

    Thanks so much for the tip! worked great! I love when developers share! K.

    Reply
  16. Christoph
    Christoph

    Just start Xcode and accept the Licence. I had to install some updates, but after quitting Xcode I was able to use git as usual.

    Reply
  17. Mehrad
    Mehrad

    it saved lot of my time, thanks (y)

    Reply
  18. Tom
    Tom

    Whew. Thanks for your post. And thanks for having good enough SEO to appear high in my Google search. The panic that I had broken something was palpable.

    Reply
  19. Fran
    Fran

    Thanks for your post, It helped me a lot.

    Reply
  20. Git error after updating Xcode - NixSOS
    Git error after updating Xcode - NixSOS
    Reply
  21. Grunt build
    Grunt build

    Thanks dude, I suddenly was not able to perform a Grunt build command anymore (as it requires git). When I read your post I recalled seeing this nice growl message this morning telling me xcode had been updated.

    This fixed it.

    Thanks

    Reply
  22. Moses
    Moses

    Thank you so,

    And to echo Tom: And thanks for having good enough SEO to appear high in my Google search.

    Reply
  23. Nicolas Widart
    Nicolas Widart

    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

    Reply
  24. Nicolas Widart
    Nicolas Widart

    I tried looking on the web for answers, haven’t found anything that fixed the issue yet.

    Your link gives some pointers, but for windows. I’m using a Mac. I’ve tried those 3 commands just in case but it’s still extremely slow.

    Thanks,

    Reply
  25. Nicolas Widart
    Nicolas Widart

    Thanks Page for the help. I’ve finally chosen to remove Yadr (https://github.com/skwp/dotfiles) and perform a clean install. Everything seems to be working fine again. πŸ™‚

    Reply
    • Page Wood
      Page Wood

      Anytime, glad to hear it’s all working as expected now πŸ™‚

      Reply
  26. EDL
    EDL

    Thanks! helpful

    Reply
  27. Alex
    Alex

    You da man!

    Reply
  28. Saichand
    Saichand

    Thanks a ton. This worked for me.

    Reply
  29. Avery
    Avery

    From a newbie, THANK YOU!!! I was very stuck, and never would have figured this out. Being stuck sucks and were officially in a small group of people needing more technical help. New coder in training here.

    Avery,

    Reply
  30. Marianna
    Marianna

    When i try to run this to my terminal i get a password
    were i can type actually anothing , when i press enter i get fail up to 3 times and then from the begining again. What am i missing here?

    Reply
    • Page Wood
      Page Wood

      Hey Marianna! When you type password entries into terminal, no characters are shown but the characters are still entered. Just type your admin password, then hit enter and you should be good to go.

      Reply
  31. GBMan
    GBMan

    Thanks for the tip.
    Am I the only one to find very weird and intrusive IntelliJ can’t work because of an XCode license agreement?

    Reply
  32. Denis
    Denis

    The post didn’t helped me.
    Maybe it is to old, maybe I have a different issue.
    I just updated to El Capitan and my Git in Intellij IDEA 14 stopped working. It said that Git can’t start, because the path is incorrect, but is was.
    So “sudo xcodebuild -license” resulted in a “xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance”.
    I simply don’t have XCode and I don’t need it.
    The solution I found helped.
    In terminal type
    xcode-select –install
    and then click on “install”, not “Get Xcode”. Git worked fine after that.
    Will just leave it here since it is one of the first link in goolge.

    Reply
    • Page Wood
      Page Wood

      Denis, you’re right – you can either install Xcode or Command line tools to use Git on a mac. Looks like you opted for command line tools. I personally always install Xcode because of its built in device simulators that are great for debugging front-end code on ios devices. Glad you were able to get things going!

      Reply

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *