我的情况:
command line可以使用git,但是 rstudio的version control无法使用,显示信息为:
Git was not detected on the system path
参照文章 Rstudio cant detect git
打开Rstudio -> Tools -> Global Options -> Git/SVN
在preference里找也一样
然后重新填上正确的git的地址。
神奇的是在这一步,我原来的地址是可以找到一个git的执行文件的。
所以我又到终端里检查了一下,它使用的git的位置
which git
显示出来果然不是之前那个。 (之前是/usr/bin/git,现在是/usr/local/bin/git)
apply-> ok
问题解决。
如果终端内都无法使用git,可能需要重新安装command line tool或者git了
可以参考这篇文章:
mac系统升级macOS big sur 后git 失效解决方法