问题描述
在给Mac安装git时碰到一个问题,命令行无法执行git命令,提示
xcode-select: note: no developer tools were found at '/Applications/Xcode.app',
requesting install. Choose an option in the dialog to download the command line
developer tools.
并弹出如下对话框提示安装Xcode
原因分析
在Mac中,我安装了Xcode,安装Xcode时,会预装git wrapper,路径为:
/usr/bin/git
所以系统在执行git指令时先搜索到该路径,而本地安装的git路径为:
/usr/local/git