V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Conty
V2EX  ›  问与答

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

  •  
  •   Conty · 2021-05-04 11:14:32 +08:00 · 1979 次点击
    这是一个创建于 1059 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ➜ ~ 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",

    多谢!
    4 条回复    2021-05-04 17:58:40 +08:00
    ladypxy
        1
    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
        2
    Conty  
    OP
       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
        3
    Conty  
    OP
       2021-05-04 13:50:26 +08:00   ❤️ 1
    对不起诸位老大,这是一个愚蠢的问题。原因是我在用 Remote SSH,而远端服务器的 git 仍然是 1.8 。在将远端服务器的 git 重新 build 成 2.31 之后问题消失。
    Zien
        4
    Zien  
       2021-05-04 17:58:40 +08:00 via iPhone
    @Conty 哈哈哈哈哈😂
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5137 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:42 · PVG 17:42 · LAX 02:42 · JFK 05:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.