我在部署到 Heroku 期间收到有关 git 1.9.3 严重安全漏洞的警告
我尝试通过 homebrew 更新 git 但发现 git 最初并不是通过 homebrew 安装的
然后我通过自制程序安装了它
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
???? /usr/local/Cellar/git/2.2.1: 1356 files, 31M
之后当我检查 git 版本时它保持不变
⇒ git --version
git version 1.9.3 (Apple Git-50)
在我看来homebrew已安装git在文件夹中/usr/local/Cellar/git/2.2.1
最后我的问题是:
我应该做什么才能开始使用自制git而不是原来的git?
⇒ which git
/usr/bin/git
⇒ git --version
git version 1.9.3 (Apple Git-50)
您需要重命名原来的git at /usr/bin/git, e.g.
sudo mv /usr/bin/git /usr/bin/git-original
现在再次检查位置和版本
⇒ which git
/usr/local/bin/git
⇒ git --version
git version 2.2.1
添加符号链接以实现向后兼容性(如果您的 IDE 使用 git 的直接位置)
sudo ln -s /usr/local/bin/git /usr/bin/git
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)