git 的较新版本已安装在 OSX 上,但未被使用。我怎样才能找到它并使用它?

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

我正在尝试将 git 从默认的 mac 版本更新到更新的版本。我已经安装了更新版本(如下所示),但我不知道它在哪里。

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

如何找到 git 2.2.2 的安装路径以便我可以使用它?我是初学者,正在了解环境变量和 $PATH 变量的概念。

作为参考,这里是我的.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

此外,在另一个答案中,建议将 git 的默认 mac 版本重命名为我从 gitgit-apple 所做的另一个名称。

感谢您的帮助。

试试这个:

brew link git

希望对您有所帮助