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

I received a warning regarding serious security vulnerability of git 1.9.3 during deploy to Heroku

I tried to update git via homebrew but found that git was not originally installed via homebrew

  • Using git commit id and tag as Jenkins build parameters
  • How to determine if a file is identical to one in git's history
  • Gerrit replication to different repo/projects names
  • Multiple Git repositories in one directory
  • Git checking out remote branch without specifying `origin/`
  • List last edits of all file by a collection of users
  • Then I installed it via 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 git version it remained the same

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

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

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

  • How do I get git branch history to match master after a squash rebase?
  • gerrit+apache2 can't sign out
  • npm error: cloning into bare repository + unable to find remote helper for https
  • Move existing, uncommited work to a new branch in Git
  • git: Is there a command line option for “Sort by date” for gitk?
  • RA layer request failed? what git-svn did to the repo?
  • 2 Solutions collect form web for “WARNING: Your version of git is 1.9.3. has serious security vulnerabilities”

    ⇒  which git
    /usr/bin/git
    
    ⇒  git --version
    git version 1.9.3 (Apple Git-50)
    

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

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

    Now check 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 to git)

    sudo ln -s /usr/local/bin/git /usr/bin/git
    

    Like Jubobs commented, you can simply add it to your path like so:

    echo ‘export PATH=”/usr/local/git/bin:$PATH”‘ >> ~/.bash_profile

    Just change ~/.bash_profile to whatever bash profile file you’re using.

    Git Baby is a git and github fan, let's start git clone.