brew update: The following untracked working tree files would be overwritten by merge:

Don’t forget to fetch the origin:

cd /usr/local/Homebrew
git fetch origin
git reset --hard origin/master

What happens is that you are trying to update brew, but brew itself is either not up to date (likely), there is a permissions change via some OS update (also likely), or brew is slightly corrupt (unlikely). Since brew itself is a git repo, you have to update or reset brew to the master branch version. brew [by default] is located in the /usr/local/Homebrew folder, so you

  1. Go to that folder [first command] which also should update permissions (if not see below)
  2. Fetch the origin [second command] which means to update your LOCAL version of the remote branch of brew
  3. Hard reset [3rd command] based on the REMOTE master branch (which also uses your current permissions).

You can also chown the first command if you are in a non sudo or admin profile

sudo chown -R `whoami` /usr/local/Homebrew
cd /usr/local/Homebrew
git reset --hard origin/master

To understand git reset, take a look at this article.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)