Brew Update Error: Failure while executing: git stash pop --quiet


After updating to OS X El Capitan (Mac OS 10.11) I tried to update brew and got a couple lovely errors:

Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami):admin /usr/local

 

-- And this one --

 

Error: Failure while executing: git stash pop --quiet

References:

 

Solution

So, I was able to get brew to update but it wasn't exactly intuitive. The first error was resolved by command suggested in the error message:

sudo chown -R $(whoami):admin /usr/local

 

The second error would not yield to anything that I found online. The solution was incredibly simple, yet not obvious at the same time:

  • cd ~/
  • brew update

Apparently it makes a difference WHERE I execute brew update. After executing brew update from my home directory, it updated fine.