Brew无法找到git,即使git in path(Mac / OSX)

时间:2016-04-08 04:03:34

标签: git macos path command-line-interface homebrew

安装brew报告,它无法找到git,并因错误而死亡。 Brew似乎已安装(成功?)

> brew

(打印常用帮助)

...但brew doctor不满意:

这是我运行brew医生时得到的,(当我第一次按照Homebrew主页上的说明安装brew时。)

> brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Git could not be found in your PATH.
Homebrew uses Git for several internal functions, and some formulae use Git
checkouts instead of stable tarballs. You may want to install Git:
  brew install git
Error: Git is unavailable
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q

我的路径:

> echo $PATH
/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Git在这里:

> which git
/usr/bin/git

2 个答案:

答案 0 :(得分:2)

您是否安装了命令行工具?

xcode-select --install

答案 1 :(得分:-1)

Brew可能适合你,你可以brew install没有任何问题。

看起来brew doctor希望您使用brew安装git,而不是使用OSX系统默认安装git

要让brew doctor满意,请运行:

> brew install git

这会将git安装到/usr/local/bin/git,并可能导致错误消失。