How to update my git version in OSX 10.8

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.

+5
3

/usr/bin /usr/local/bin , git /usr/bin . :

export PATH=/usr/local/bin:$PATH
which git 

homebrew , macos

+16

Mac OSX - (), Mac ( .dmg .pkg).

git : http://git-scm.com/download/mac ( git Mac).

( , 10.8.3 MacBook) : git /usr/local/git, $PATH - .

.bashrc, - , :

export PATH=/usr/local/git/bin:$PATH

, git:

$ git --version
git version 1.8.2.2 

, , (, -) - script, ; . README.

+17

Cygwin ( linux, Windows).

which git

and he would respond with the correct location of the updated git compiled from the source code, but would not actually use it until he did

hash -r git

I am not saying that I understand what it did or why it was necessary to do it, but after that it git --versionanswered "1.8.2.rc0.22.gb3600c3", which was obviously not the old git shipped with Cygwin. This may not apply to OSX, but give it a chance if it which gitfinds an updated binary.

+3
source

All Articles