错误信息
Running `brew update --auto-update`...
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please
rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
解决方法
- 运行
brew doctor
,根据相关提示处理一些检测出来的问题。 - 运行
find /usr/local/Homebrew -name "rebase-merge"
example:
$ find /usr/local/Homebrew -name "rebase-merge"
/usr/local/Homebrew/Library/Taps/gcenx/homebrew-wine/.git/rebase-merge
我这里是 wine的库出问题了。
$ cd /usr/local/Homebrew/Library/Taps/gcenx/homebrew-wine/
$ git status
On branch master
Your branch is behind 'origin/master' by 20 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
Last command done (1 command done):
pick cd3fe3f cleanup casks
No commands remaining.
You are currently editing a commit while rebasing branch 'master' on 'a325900'.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit, working tree clean
## 看得出来 git关联的是master分支,那么我们就强行恢复master分支
$ git reset --hard origin/master
$ cd ~
$ brew update
Already up-to-date.
到这里,brew update正常了。