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

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

>酿造

(打印常用的帮助)

…但酿酒医生不高兴:

这就是我运行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

最佳答案 你安装了命令行工具吗?

xcode-select --install
点赞