Brew update failed: untracked working tree files would be overwritten by merge

后端 未结 12 795
旧巷少年郎
旧巷少年郎 2020-12-12 09:03

Trying to update Homebrew with brew update I got the following error

error: The following untracked working tree files would be overwrittenby me         


        
12条回答
  •  抹茶落季
    2020-12-12 09:22

    This is caused by an old bug in the update code that has long since been fixed. However, the nature of the bug requires that you do the following:

    cd $(brew --repository)
    git reset --hard FETCH_HEAD
    

    If brew doctor still complains about uncommitted modifications, also run this command:

    cd $(brew --repository)    
    git clean -fd
    

提交回复
热议问题