homebrew 执行 brew update 报 rebase-merge 错误问题解决

错误信息

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.

解决方法

  1. 运行brew doctor,根据相关提示处理一些检测出来的问题。
  2. 运行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正常了。

打赏
Bookmark the permalink.
0 0 投票数
文章评分
订阅评论
提醒
guest

0 评论
内联反馈
查看所有评论