我正在尝试将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版本重命名为我从git
到git-apple
执行的另一个名称。
感谢您的帮助。
答案 0 :(得分:1)
试试这个:
brew link git
希望有所帮助