WARNING: Your git version is 1.9.3. has serious security vulnerabilities

I got a warning about git 1.9.3 serious security vulnerability during deployment in Heroku

I tried updating git via homebrew, but found that git was not originally installed via homebrew

Then I installed it through 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 

After that, when I checked the git version, it remained the same

 git --version git version 1.9.3 (Apple Git-50) 

It seems to me that homebrew has git installed in the /usr/local/Cellar/git/2.2.1 folder

And finally, my question is: what should I do to start using homebrew git instead of the original git ?

+7
git security homebrew heroku macos
source share
2 answers
 which git /usr/bin/git ⇒ git --version git version 1.9.3 (Apple Git-50) 

You need to rename the original git to / usr / bin / git , e.g.

 sudo mv /usr/bin/git /usr/bin/git-original 

Now check the location and version again

 which git /usr/local/bin/git ⇒ git --version git version 2.2.1 

Add a symlink for backward compatibility (in case your IDE uses direct location for git)

 sudo ln -s /usr/local/bin/git /usr/bin/git 
+17
source share

As Jubobs commented, you can simply add it to your path as follows:

echo 'export PATH = "/ usr / local / git / bin: $ PATH"' → ~ / .bash_profile

Just change the ~ / .bash_profile file to whatever bash profile file you are using.

+6
source share

All Articles