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;

  • HOMEBREW_VERSION: 0.9.5
  • ORIGIN: https://github.com/Homebrew/homebrew
  • HEAD: f550366b94ab3022d325c9f5bcad496993d80c37
  • HOMEBREW_PREFIX: /usr/local
  • HOMEBREW_CELLAR: /usr/local/Cellar
  • CPU: 8-core 64-bit
  • ivybridge OS X: 10.9.3-x86_64
  • Xcode: 5.1.1 CLT: 5.1.0.0.1.1396320587
  • Clang: 5.1 build 503 X11: 2.7.5 => /opt/X11 System Ruby: 1.8.7-358
  • Perl: /usr/bin/perl
  • Python: /usr/local/bin/python =>/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
  • Ruby: /usr/bin/ruby
  • 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.


    尝试以下操作:

    cd $(brew --prefix)
    git fetch origin
    git reset --hard origin/master
    brew cleanup --force
    brew update
    
    链接地址: http://www.djcxy.com/p/63352.html

    上一篇: 创建VerticalRuler并添加信息

    下一篇: 错误:无法取消旧的'README.md'链接(操作不允许)