Macos 警告:您的git版本是1.9.3。存在严重的安全漏洞

Macos 警告:您的git版本是1.9.3。存在严重的安全漏洞,macos,git,security,heroku,homebrew,Macos,Git,Security,Heroku,Homebrew,在部署到Heroku期间,我收到了关于git 1.9.3严重安全漏洞的警告 我试图通过自制更新git,但发现git最初不是通过自制安装的 brew update brew install git ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.2.1.mavericks.bottle.tar.gz #############################################

在部署到Heroku期间,我收到了关于git 1.9.3严重安全漏洞的警告

我试图通过自制更新git,但发现git最初不是通过自制安装的

brew update
brew install git

==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.2.1.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.2.1.mavericks.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain

The "contrib" directory has been installed to:
/usr/local/share/git-core/contrib

Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
⇒  which git
/usr/bin/git

⇒  git --version
git version 1.9.3 (Apple Git-50)
然后我通过自制软件安装了它

brew update
brew install git

==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.2.1.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.2.1.mavericks.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain

The "contrib" directory has been installed to:
/usr/local/share/git-core/contrib

Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
⇒  which git
/usr/bin/git

⇒  git --version
git version 1.9.3 (Apple Git-50)
brew更新
brew安装git
==>下载https://downloads.sf.net/project/machomebrew/Bottles/git-2.2.1.mavericks.bottle.tar.gz
######################################################################## 100.0%
==>浇注git-2.2.1.mavericks.瓶子.tar.gz
==>注意事项
OS X keychain凭据帮助程序已安装到:
/usr/local/bin/git凭证osxkeychain
“contrib”目录已安装到:
/usr/local/share/git core/contrib
Bash completion已安装到:
/usr/local/etc/bash_completion.d
zsh completion已安装至:
/usr/local/share/zsh/站点功能
==>摘要
您需要在/usr/bin/git处重命名原始git,例如

⇒  which git
/usr/local/bin/git

⇒  git --version
git version 2.2.1
现在再次检查位置和版本

sudo ln -s /usr/local/bin/git /usr/bin/git
添加符号链接以实现向后兼容性(如果您的IDE使用git的直接位置)


如Jubobs所评论的,您可以简单地将其添加到您的路径中,如下所示:

echo'export PATH=“/usr/local/git/bin:$PATH”>>~/.bash\u配置文件


只需将~/.bash_profile更改为您正在使用的任何bash profile文件。

谢谢@Jubobs,但我需要在我的IDE中更改git的路径mv:rename/usr/bin/git to/usr/bin/git original:Operation not permitted谢谢@mrstif,但在我的IDE中更新git的新路径无法解决问题(RubyMine)当然@SergeSeletskyy,对于git文件夹的硬编码引用,您可以直接使用解决方案更改它,或者只需编辑软件的设置……这对我来说很有效,但是你能解释一下为什么这解决了我的问题吗?@katzkode这基本上是因为系统的PATH变量定义了哪些可执行文件可以直接在终端中找到。我提供的命令只是将新的Git安装文件夹前置到该变量,因此,当您在终端中键入“Git”时,系统将从第一个变量开始在PATH变量中指定的文件夹中查找该命令。因为新安装的是第一个,所以它会选择那个而不是系统的。更多关于