Tôi đang chạy:cập nhật Homebrew thất bại: "Xin vui lòng, cam kết thay đổi của bạn hoặc giấu chúng trước khi bạn có thể hợp nhất"
brew update
Và tôi nhận được một lỗi:
error: Your local changes to the following files would be overwritten by merge:
samtools.rb
Please, commit your changes or stash them before you can merge.
Aborting
Hóa ra đây là một lỗi nổi tiếng. Thực tế, nó được đề cập trên số Homebrew wiki:
After running brew update, you receive a git error warning about untracked files or local changes that would be overwritten by a checkout or merge, followed by a list of files inside your Homebrew installation.
This is caused by an old bug in 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)/Library
git clean -fd
Tôi làm theo các hướng dẫn đó và vẫn thấy lỗi tương tự. Chuyện gì thế?
Cảm ơn! nó cố định một trong những xung đột git của tôi. Chính xác thì git reset --hard FETCH_HEAD? –
Khi tôi gặp sự cố này, tôi phải rm tệp vi phạm trong/usr/local/Formula/Library và sau đó "git reset --hard FETCH_HEAD" sau khi bản cập nhật brew hoạt động – petrocket
Điều này đã làm cho tôi, cảm ơn bạn rất nhiều để chia sẻ! –