VSCode MAC 总是用默认的 git 1.8,即使我已经安装好了最新版,仍然告诉我“You seem to have git 1.8.3.1 installed. Code works best with git >= 2“。

2021-05-04 11:14:32 +08:00
 Conty
➜ ~ which git
/usr/bin/git
➜ ~ git --version
git version 2.24.3 (Apple Git-128)

从来没有安装过 xcode 。

VSCode 是 1.55.2 。

已经在 settings.json 里面加了

"git.enabled": true,
"git.path": "/usr/bin/git",

多谢!
2022 次点击
所在节点    问与答
4 条回复
ladypxy
2021-05-04 11:28:18 +08:00
试了下
%which git
/usr/local/bin/git
%git --version
git version 2.31.1

你用 Homebrew 安装一下 git
Conty
2021-05-04 11:45:29 +08:00
@ladypxy
➜ ~ brew install git
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 10 formulae.
==> New Casks
tabtopus
==> Updated Casks
Updated 56 casks.
==> Deleted Casks
duckstation

Warning: git 2.31.1 is already installed and up-to-date.
To reinstall 2.31.1, run:
brew reinstall git
Conty
2021-05-04 13:50:26 +08:00
对不起诸位老大,这是一个愚蠢的问题。原因是我在用 Remote SSH,而远端服务器的 git 仍然是 1.8 。在将远端服务器的 git 重新 build 成 2.31 之后问题消失。
Zien
2021-05-04 17:58:40 +08:00
@Conty 哈哈哈哈哈😂

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/774828

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX