我正在尝试将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
to所做的另一个名称git-apple
。
谢谢您的帮助。
试试这个:
brew link git
希望能帮助到你
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句