Visual Studio Code reports "It look like git is not installed on your system." when I try to switch to the git view. I know I have git installed and used by other Git clients. I guess if I reinstall Git following Visual Studio Code's instruction ("install it with Chocolatey or download it from git-scm.com"), it probably can fix the problem, but I don't want to mess up the existing Git clients on my system. Is there a reliable way to configure Visual Studio Code so it can find existing git installation?


当前回答

我发现在设置中有git: false。Json,并将其更改为true。现在起作用了。

其他回答

在更新macOS后遇到了这个问题!

再次使用自制软件安装git,它工作了!

brew install git

Windows 10操作系统:

我的问题是我在管理模式下使用PowerShell克隆了存储库。当我不在管理模式下启动PowerShell时,VS Code可以检测到Git回购。

在Visual Studio Code中,打开“用户设置”:Ctrl + P并输入>set。按回车。

这将在左侧打开默认设置,在右侧打开用户设置。

只需要在用户设置中添加git.exe的路径:

"git.path": "C:\\Users\\[WINDOWS_USER]\\AppData\\Local\\Programs\\Git\\bin\\git.exe"

用你的用户名替换[WINDOWS_USER]。

重新启动Visual Studio代码。

我最近开始使用Visual Studio Code。我有这个问题,只是写Git可执行文件的确切路径解决 这个问题。代码如下:

“git。C:\Program Files\Git\bin\ Git .exe

WINDOWS 10

没有什么能帮我摆脱困境。

问题出现在IntelliJ Idea和VSCode中。

VSCode中的Git选项卡让我Init存储库-它没有检测到工作区中有一个. Git文件夹。

当我在VSCode中从控制台执行git拉时,它要求我通过web浏览器添加凭据。在我登录后,git问题被修复,所有的插件开始工作。 我需要为每个克隆的存储库这样做,即使我在git克隆期间使用了正确的凭据…命令。

Ps.我在Windows上使用CMD通过HTTPS从Gitlab克隆了存储库。VScode使用Powershell -这可能是原因。