如何将Git升级到OS X上的最新版本? [英] How to upgrade Git to latest version on OS X?
问题描述
我刚刚购买了一台配备OS X Lion的新Mac,并且我在终端中检查了默认情况下安装了哪个版本的git。我得到了答案
git --version
> git版本1.7.5.4
我想将git升级到最新版本1.7.8.3,所以我下载了dmg安装程序git-1.7.8.3-intel-universal-snow-leopard.dmg,然后我启动了它。
安装完成后,终端仍然说版本是1.7.5.4。我做错了什么?
如果您添加以下内容,可能会更好:
export PATH = / usr / local / git / bin:/ usr / local / sbin:$ PATH
添加到您的主文件夹中名为.bashrc的文件中。这样,您可能安装在 / usr / local / git / bin
中的任何其他软件也会首先被找到。
<只要输入:
echoexport PATH = / usr / local / git / bin: / usr / local / sbin:$ PATH>> 〜/ .bashrc
放入终端,它会为您做到。
I just bought a new Mac with OS X Lion and I checked in the Terminal what version of git is installed by default. I got the answer
git --version
> git version 1.7.5.4
I would like to upgrade git to the latest version 1.7.8.3, so I downloaded the dmg installer "git-1.7.8.3-intel-universal-snow-leopard.dmg" and I launched it.
After the install, the Terminal still says that the version is 1.7.5.4. What am I doing wrong?
It would probably be better if you added:
export PATH=/usr/local/git/bin:/usr/local/sbin:$PATH
to a file named .bashrc in your home folder. This way any other software that you might install in /usr/local/git/bin
will also be found first.
For an easy way to do this just type:
echo "export PATH=/usr/local/git/bin:/usr/local/sbin:$PATH" >> ~/.bashrc
into the Terminal and it will do it for you.
这篇关于如何将Git升级到OS X上的最新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!