I am on OSX 10.8.2 and I am running git git v1.7.4.4
I just installed git on a remote server, and it is version 1.11.x. I would like to run the same version of software, but I cannot figure out how to update git on my laptop.
I tried to follow the steps below, which indicate that you will download git-OSX-installer , run the installer (which runs smoothly), and then run:
$ sudo mkdir -p /usr/local/bin
$ sudo ln -s /usr/local/git/bin/git /usr/local/bin/git
But after that I do git --version, and it's still 1.7.4.4. Did I just reinstall the same version? Or did I install a newer version somewhere else?
I read similar questions, and I think the problem is that OSX comes with an old version of git installed elsewhere where the git -osx-installer or mac ports will be hosted. But I'm not sure how to fix it. Thanks in advance for your advice.
Update:
which git returns: / usr / bin / git
echo $PATHreturns: /opt/local/bin:/opt/local/sbin:/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ ruby-1.9.3- p194 @ global / bin: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin: / USR / local / RVM / bin: / USR / bin: / bin: / USR / SBIN: / SBIN: / Usr / local / bin: / usr / local / git / bin: / opt / cm / bin: / opt / cm / pack / active / bin: / opt / cm / pack / active / sbin
Update2:
ESL ~/Downloads$ export PATH=/usr/local/bin:$PATH
ESL ~/Downloads$ which git
/usr/local/bin/git
ESL ~/Downloads$
ESL ~/Downloads$ git --version
git version 1.8.1.3
Looks like I installed the new version of git in local. So what should I add export PATH=/usr/local/bin:$PATHto my .bash_profile? The problem is that both versions of git are installed?
export PATH=/usr/local/bin:$PATH ~/.bash_profile, git.