在官方下载mac git版本后,安装发现还需要提示需要安装啥命令行软件啥的,遂放弃。改为使用在软件商店xcode,其安装后集成git,直接使用。
1、安装xcode后,终端输入命令 git --version (成功)
2、vscode打开项目,发现左下角无分支名,gitlens插件提示:Unable to initialize Git; AggregateError(2) Error: Unable to find git Error: Unable to find git
3、百度上说需要在设置里增加一条命令git.path,添加git的安装路径
终端输入命令 where git 会出现两条路径:

/usr/local/bin/git
/usr/bin/git

!!!百度上说用第一条,但我写入,重启vscode,还是无效,于是拿第二条路径试了试,可以了。

截屏2024-04-04 21.56.07.png


Lito
1 声望1 粉丝