Newer version of git installed on OSX but not being used. How can I find it and use it?

I’m trying to update git from the default mac version to a newer version. I already have a newer version installed (as seen below) but I don’t know where it is.

Aarons-iMac:~ AaronWilliamson$ cd
Aarons-iMac:~ AaronWilliamson$ git --version
-bash: git: command not found
Aarons-iMac:~ AaronWilliamson$ brew upgrade git
Error: git 2.2.2 already installed

How can I locate the path to where git 2.2.2 is installed so I can use it? I’m a beginner and am in the process of understanding the concepts of environment variables and the $PATH variable.

  • upgrade Git on Mac
  • 'chcp' is not recognized as an internal or external command, operable program or batch file. on a Windows PC
  • How to use environment variable for Git remote URL
  • How do you set default application for `open` command in terminal based on file extension type?
  • Set Xcode project version from custom environment variable
  • NSTask and Git — Permissions issues
  • For reference, here are the contents of my .bash_profile

    export PATH=/bin:/usr/local/bin:$PATH
    export PATH="/usr/local/bin:$PATH"
    source /usr/local/opt/chruby/share/chruby/chruby.sh
    source /usr/local/opt/chruby/share/chruby/auto.sh
    export PATH=./bin:/usr/local/bin:$PATH
    source /usr/local/opt/chruby/share/chruby/chruby.sh
    source /usr/local/opt/chruby/share/chruby/auto.sh
    source ~/.profile
    export PGDATA=/usr/local/var/postgres
    export PGHOST=/tmp
    export PGDATA=/usr/local/var/postgres
    export PGHOST=/tmp
    export PGDATA=/usr/local/var/postgres
    export PGHOST=/tmp
    export PGDATA=/usr/local/var/postgres
    export PGHOST=/tmp
    
    ### Added by the Heroku Toolbelt
    export PATH="/usr/local/heroku/bin:$PATH"
    
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" #             Load RVM into a shell session *as a function*
    source ~/.rvm/scripts/rvm
    

    Also, in another answer, it was recommended to rename the default mac version of git to another name which I did from git to git-apple.

    Thank you for your help.

  • Use Git “locally” over SSH
  • Using GIT on USB stick for “travelling code”
  • Can't push feature branch in git, doesn't exist in remote?
  • Multiple heroku accounts
  • symfony project from git
  • is there a way to get individual components of heroku toolbelt?
  • One Solution collect form web for “Newer version of git installed on OSX but not being used. How can I find it and use it?”

    Try this:

    brew link git
    

    Hope it helps

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