首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在VSCode中使用安装在Windows子系统中的git

在VSCode中使用安装在Windows子系统中的git
EN

Stack Overflow用户
提问于 2020-04-14 18:50:38
回答 1查看 2.6K关注 0票数 3

我通过git安装了WSL2:

代码语言:javascript
复制
Arch Linux on Windows 10 x86_64 with 4.19.84-microsoft-standard
 $ which git
/usr/sbin/git

cmd中,我可以通过wsl.exe git ...使用git,也可以通过我创建的批处理文件访问wsl程序:

代码语言:javascript
复制
 > wsl git status
On branch next
...
 > git.bat status
On branch next
...

但是,git不起作用:

代码语言:javascript
复制
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.

到目前为止我尝试过的:

我将自己的C:\Users\x\AppData\Local\Programs\Git\cmd\git.bat

  • I移动到
  • ,在设置json中放置了一个显式的git路径:

{ "git.enabled":true,"git.path":"C:\Windows\System32\wsl.exe git",//…}

这也不起作用:

代码语言:javascript
复制
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.

如果我不想安装git for ,我能做什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-14 18:56:54

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61215059

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档