akh22
akh22

Reputation: 701

error: unable to unlink old 'README.md' (Operation not permitted)

I did brew update and got a error message

Your local changes to the following files would be overwritten by merge

I've searched previous posts for a workaround and I tried a host of suggested remedies but none worked. A problem is when I fired eg. git reset --hard FETCH_HEAD I got;

error: unable to unlink old 'README.md' (Operation not permitted) fatal: Could not reset index file to revision 'FETCH_HEAD'.

I used sudo chmod and chown to change a file ownership and permission but I got the same error, "Operations not permitted".

here is an output of my brew --config;

The brew doctor had warnings indicating my /usr/local is not writeable but I had not have any problem using brew until today.

Any help will be appreciated.

Upvotes: 0

Views: 1617

Answers (1)

lucius
lucius

Reputation: 61

Try the following:

cd $(brew --prefix)
git fetch origin
git reset --hard origin/master
brew cleanup --force
brew update

Upvotes: 0

Related Questions