Mavericks, Xcode and Command Line Tool broke my Git and Homebrew!
Unlike many developers I upgraded my Mac as soon as Mavericks came out. I also went ahead and updated Xcode to 5.0.1 and installed the current Command Line Tool using the command
Even though before these updates my development environment was operating perfectly, updating broke my Git and Homebrew. Mostly it's permissions that gets changed so that you're no longer able to make the necessary changes to your Homebrew formulas especially Git.
I would get a bunch of error messages and then something about brew not being able to symlink the Git.
Normally, Homebrew installs it's symlinks in the folder
and the actual Git in the folder.
But after the upgrade, my Git was no longer symlinked to the correct folder.
$ git version 1.8.3.4 (Apple Git-47)
This clearly is NOT Homebrew's version. This is Xcode and CLT version. So, what to do?
First, I checked the Git symlink in the folder
I see that it's no longer a symlink but a folder. Somehow, the upgrade has turned my symlink into a folder. Trying to delete this Git folder would only return Permission Denied. So I used
to forcibly remove the folder.
and again it returned an error:
Uninstalling /usr/local/Cellar/git/1.8.4... Error: Permission denied - /usr/local/Cellar/git/1.8.4/share/git-gui/lib/Git Gui.app
It seems that the permissions for that
folder was changed as well with the upgrade. I then tried to forcibly delete that folder by running
$ sudo rm -rf /usr/local/Cellar/git
That will then free up that space for brew to reinstall git. Now, running
I still get permission denied in the folder
/usr/local/share/git-gui/lib/
$ sudo chmod 775 /usr/local/share/git-gui/lib
That will change the permission so that Homebrew can finally install git. Finally,
That should do it. Now when you run
it should show git installed in the correct Homebrew directory
and checking on the version
should show the current version