【问题标题】:Use git installed in Windows Subsystem for Linux in VSCode在 VSCode 中使用安装在 Windows Subsystem for Linux 中的 git
【发布时间】:2020-04-14 18:50:38
【问题描述】:

我通过 WSL2 安装了git

Arch Linux on Windows 10 x86_64 with 4.19.84-microsoft-standard
 $ which git
/usr/sbin/git

来自cmd,我可以通过wsl.exe git ... 使用git 或通过我制作的批处理文件来访问wsl 程序:

 > wsl git status
On branch next
...
 > git.bat status
On branch next
...

但是git 不起作用:

Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Program Files (x86)\Git\cmd\git.exe
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Users\x\AppData\Local\Programs\Git\cmd\git.exe
Git installation not found.

到目前为止我尝试了什么:

  • 我将git.bat 移至 C:\Users\x\AppData\Local\Programs\Git\cmd\git.bat
  • 我在设置 json 中放了一个明确的 git 路径:

    { “git.enabled”:是的, "git.path": "C:\Windows\System32\wsl.exe git", // ... }

这也不起作用:

Looking for git in: C:\Windows\System32\wsl.exe git
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Program Files (x86)\Git\cmd\git.exe
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Users\x\AppData\Local\Programs\Git\cmd\git.exe
Git installation not found.

如果我不想想为 Windows 安装 git,我该怎么办?

【问题讨论】:

    标签: visual-studio-code


    【解决方案1】:
    猜你喜欢
    • 2019-02-11
    • 2021-12-13
    • 1970-01-01
    • 1970-01-01
    • 2018-10-21
    • 2018-04-17
    • 2018-03-17
    • 2020-09-07
    • 1970-01-01
    相关资源
    最近更新 更多