brew医生说我已经对Homebrew进行了未经修改的修改,但是git status说“没什么可提交的”

时间:2012-08-20 19:55:27

标签: homebrew

我是第一次安装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上。

2 个答案:

答案 0 :(得分:12)

我有同样的问题,上述建议都没有摆脱对我的警告。

似乎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'

答案 1 :(得分:1)

我找到了问题,研究了一个不同的问题。我的电脑安装了旧版本的git(1.5.6.56.g29b0d)。它位于/ usr / local / bin / git。我下载了最新版本(1.7.11.3),它安装在/ usr / local / git / bin / git。在调整我的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更新:

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

现在看起来我很高兴:

brew doctor
Your system is raring to brew.