简体   繁体   English

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

[英]Brew cannot find git, even though git in path (Mac/OSX)

Installing brew reports that it cannot find git, and dies with an error. 安装brew报告它无法找到git,并因错误而死亡。 Brew appears to have be installed (successfully?) Brew似乎已安装(成功?)

> brew

(prints the usual help) (打印常用的帮助)

...but brew doctor is not happy: ...但brew doctor不高兴:

This is what I get when I run brew doctor, (and when I installed brew for the first time as instructed on the Homebrew homepage.) 这就是我运行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

My PATH: 我自己的路:

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

Git is here: Git在这里:

> which git
/usr/bin/git

你安装了命令行工具吗?

xcode-select --install

Brew probably works properly for you and you can brew install without any issues. Brew可能适合您,您可以毫无问题地进行brew install

Looks like brew doctor would prefer that you install git with brew instead of using the OSX system default installation of git . 看起来brew doctor更喜欢你用brew安装git而不是使用OSX系统默认的git安装。

To make brew doctor happy, run: 要让brew doctor高兴,请运行:

> brew install git

That will install git to /usr/local/bin/git and likely make the error go away. 这将把git安装到/usr/local/bin/git并可能使错误消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM