OS X 10.10:定位和使用 brew 和 Git 时出错
OS X 10.10: Errors in locating and using brew and Git
我上次使用 brew 和 Git 是几周前的事,一切都运行良好。但是,现在,当我在终端中键入 git --version
时,我得到
git: error: unable to find utility "git", not a developer tool or in PATH.
我的 /usr/local 目录中确实有一个 Git 文件夹...
如果我尝试 brew update
,我会得到完全相同的错误,加上
Error: Failure while executing: git init.
brew install git
结果:
clang: error: unable to find utility "clang", not a developer tool or in PATH
otool: error: unable to find utility "otool", not a developer tool or in PATH
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool
所以,很明显,我的 Git(和 brew?)安装或至少它的路径出现了严重错误。
如果我通过输入
手动提供路径
export PATH=/usr/local/git/bin:$PATH
在终端中然后询问我的 Git 版本,我得到正确的输出:
git version 2.3.5
谁能告诉我这里出了什么问题,或者我如何修复 Git 的路径并 brew 以便再次工作?
这是一个常见问题,即错误:
git pull
error: unable to find 2fcd18343b3817d1ed79a72c0c878811fd27e833
想法是使用:
git revert HEAD
(它可能不是最好的,但它似乎有效)
我建议也看看 ,它可以让您进一步了解如何解决问题。
祝你好运!希望对你有帮助
天哪,我都明白了!两周前我做了一件事:我安装了 Python 3.4 并卸载了预装在 OS X 上的 Python 2.7。现在我发现 Python 2.7对Xcode来说至关重要,所以我干脆重新装了一遍
现在两个 Python 版本都在我的系统上,不仅 Xcode 再次毫无怨言地工作,而且 brew 也不再产生任何错误 ...
我上次使用 brew 和 Git 是几周前的事,一切都运行良好。但是,现在,当我在终端中键入 git --version
时,我得到
git: error: unable to find utility "git", not a developer tool or in PATH.
我的 /usr/local 目录中确实有一个 Git 文件夹...
如果我尝试 brew update
,我会得到完全相同的错误,加上
Error: Failure while executing: git init.
brew install git
结果:
clang: error: unable to find utility "clang", not a developer tool or in PATH
otool: error: unable to find utility "otool", not a developer tool or in PATH
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool
所以,很明显,我的 Git(和 brew?)安装或至少它的路径出现了严重错误。
如果我通过输入
手动提供路径export PATH=/usr/local/git/bin:$PATH
在终端中然后询问我的 Git 版本,我得到正确的输出:
git version 2.3.5
谁能告诉我这里出了什么问题,或者我如何修复 Git 的路径并 brew 以便再次工作?
这是一个常见问题,即错误:
git pull
error: unable to find 2fcd18343b3817d1ed79a72c0c878811fd27e833
想法是使用:
git revert HEAD
(它可能不是最好的,但它似乎有效)
我建议也看看 ,它可以让您进一步了解如何解决问题。
祝你好运!希望对你有帮助
天哪,我都明白了!两周前我做了一件事:我安装了 Python 3.4 并卸载了预装在 OS X 上的 Python 2.7。现在我发现 Python 2.7对Xcode来说至关重要,所以我干脆重新装了一遍
现在两个 Python 版本都在我的系统上,不仅 Xcode 再次毫无怨言地工作,而且 brew 也不再产生任何错误 ...