Ser*_*o76 1 git xcode github-for-mac android-studio
我已经在Mac上安装了Git。当我在终端中执行“ whereis”操作时,路线为:
/usr/bin/git
Run Code Online (Sandbox Code Playgroud)
我使用Android Studio和GitHub桌面客户端,到目前为止没有任何问题。
以前我已经安装了Xcode,但是一周前我将其卸载了。从那时起,Android Studio不会检测到Git,我收到以下错误消息:
xcrun:错误:活动的开发人员路径(“ /Volumes/Vega/Applications/Xcode.app/Contents/Developer”)不存在,用于
xcode-select --switch path/to/Xcode.app指定您希望用于命令行开发人员工具的Xcode(或参见 参考资料man xcode-select)
Android Studio显示了指向Git的相同可执行路径,指示了终端(/usr/bin/git),但是当我单击“测试”按钮时,它也会显示相同的错误。
我在终端上对Git的处理不太好,始终使用桌面客户端。
卸载Xcode后,我该怎么做才能继续在Android Studio(或其他任何地方)上使用Git?
我搜索了信息,但无法解决。
如果命令sudo xcode-select --reset和xcode-select --install对您不起作用,并且您不想安装xcode,则只需通过brew以下命令手动重新安装git :
brew reinstall git
Run Code Online (Sandbox Code Playgroud)
并打开新的终端会话
为我工作