修改环境变量,将新的git路径写入系统环境变量打开.bash_profile文件(vi ~/.bash_profile),将新的git路径写进去,保存然后执行:source ~/.bash_profile PATH=/usr/local/git/bin:$PATH export PATH