2

我是第一次安装 brew,当我运行 brew doctor 时出现一个错误:

Warning: You have uncommitted modifications to Homebrew
If this a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
    cd /usr/local && git stash

如果我 cd 到 /usr/local 并运行“git status”,我会得到:

On branch master
nothing to commit (working directory clean)

如果我运行: cd /usr/local && git stash,我得到:

No local changes to save

我应该忽略这个警告吗?我在 OSX 10.8 上。

4

2 回答 2

13

我遇到了同样的问题,上述建议都没有消除对我的警告。

似乎 Homebrew 会抱怨未提交/未隐藏的更改,即使它们没有被添加到提交中,如果它们没有被添加到提交中, git stash 不会做任何事情。

所以我必须做的是:

$ cd /usr/local
$ git add .    # add the unsaved changes homebrew is complaining about
$ git stash    # stash the changes, now that they're in a commit
$ brew update  # update homebrew
$ brew doctor  # running brew doctor now outputs 'raring to brew'

或者,如果您愿意,一次运行所有内容:

cd /usr/local/Homebrew && git add . && git stash && git clean -d -f && brew update && brew doctor
于 2013-01-21T18:34:58.220 回答
1

我发现了问题,研究了一个不同的问题。我的电脑安装了旧版本的 git (1.5.6.56.g29b0d)。它位于 /usr/local/bin/git。我下载了安装在 /usr/local/git/bin/git 的最新版本(1.7.11.3)。在调整我的 PATH 以识别新的 git 之后,我能够克服上述错误。

brew doctor
Warning: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!

然后我能够成功运行 brew update :

brew update
Updated Homebrew from ed127082 to 4a36c56a.
...

现在看来我可以走了:

brew doctor
Your system is raring to brew.
于 2012-08-21T21:06:51.440 回答