Fix git After High Sierra Upgrade
Every major operating system upgrade is a grand adventure. No matter the vendor or how vanilla you keep your system: stuff is going to break. This was very much the case with git when I upgraded my MacBook Pro to High Sierra.
After the upgrade I tried to pull down a git branch and received the following cryptic error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Every OS upgrade is interesting in its own ways but you can bet your life that something relating to Xcode will go wrong. I tried using Homebrew to install git by itself (brew install git) but that didn't ensure git worked properly so I went with a fix that's worked in the past:
xcode-select --install
The command above restored git and I was able to instantly get back to work. The mystery of how Xcode and its developer tools getting ruined with every install is really something Apple should address. In any event, keep this blog post handy each time you upgrade your Mac operating system!
![7 Essential JavaScript Functions]()
I remember the early days of JavaScript where you needed a simple function for just about everything because the browser vendors implemented features differently, and not just edge features, basic features, like addEventListener and attachEvent. Times have changed but there are still a few functions each developer should...
![How to Create a RetroPie on Raspberry Pi – Graphical Guide]()
Today we get to play amazing games on our super powered game consoles, PCs, VR headsets, and even mobile devices. While I enjoy playing new games these days, I do long for the retro gaming systems I had when I was a kid: the original Nintendo...
![Dijit’s TabContainer Layout: Easy Tabbed Content]()
One of Dojo's major advantages over other JavaScript toolkits is its Dijit library. Dijit is a UI framework comprised of JavaScript widget classes, CSS files, and HTML templates. One very useful layout class is the TabContainer. TabContainer allows you to quickly create a tabbed content...
![CSS Sprites]()
The idea of CSS sprites is pretty genius. For those of you who don't know the idea of a sprite, a sprite is basically multiple graphics compiled into one image. The advantages of using sprites are:
Fewer images for the browser to download, which means...
Thanks for the heads up!
Not only does this happen with every OS update, but I also had to recover my customized Apache configuration – using the builtin Apache on macOS – every time after a major update. Fortunately the old config files are backed up upon starting the update.
This is not something that’s ever happened to me in all the OS upgrades I’ve done. Git has always continued to work just fine. However, I’ve saved a link to this post just in case – there’s always a first time!
Thanks! Upgraded yesterday evening. This morning at work I find out git stopped working. Found your post and the fix worked like a charm.
It doesn’t happened to me till i have upgraded the operating system with Sierra. I have bookmarked this page, if i will face any issue with the update.
Thank you,
Thanks, you saved me time! I just updated MacOS over the weekend. I read your post this morning so I tried to pull a branch to see if I had the same issue, and I did. Your solution put a quick stop to the issue, thanks for giving me an instant solution!
FYI, this didn’t work for me after installing the 10.13.1 update and finding Xcode command line tools broken like this.
I got
errors for brew commands, gcc commands, etc.
It seems these days, every time Apple update something, they’re breaking something, too :/
FWIW, my issue was that somehow the path was now wrong. It worked yesterday, so don’t look at me. But the fix, for me, was:
to set the correct path.
This worked for me! Saved my life, thank you.
Thanks Daniel.. this worked for me.
So simple, yet so great! Thank you so much.
Arsalan
Hi – just wanted to say thank you for posting this. I updated MacOS today from El Capitan to High Sierra. I did some code updates, tried to push them and got an error. I reinstalled the dev tools using your Terminal command, and hey presto, git is working again. :-)