Why is the Git version I install with Homebrew different from the version on the website?

霸气de小男生 提交于 2019-12-10 11:17:14

问题


When I installed Git with Homebrew it shows as version 1.8.5.2 but on the website the download is for 2.0.1.

Why is Homebrew installing a different version of Git?


回答1:


Make sure the pre-installed git path (/usr/bin/git) isn't before the one installed by brew (/usr/local/bin/git).

Check if /usr/local/bin/git --version returns the expected version.
Or /usr/local/git/bin/git --version.

See more at:

  • "Homebrew installation of git won't take precedence over system version (in /usr/bin/)"
  • "How to properly update git on mac?"
  • "Which Git? How to Keep Git Up To Date on Mac"

    export PATH=/usr/local/bin:$PATH 
    brew install git
    brew upgrade git
    


来源:https://stackoverflow.com/questions/24968761/why-is-the-git-version-i-install-with-homebrew-different-from-the-version-on-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!