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?


当前回答

WINDOWS 10

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

问题出现在IntelliJ Idea和VSCode中。

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

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

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

其他回答

如果git在操作系统更新后丢失,在我的大苏尔的情况下,只是字面上:brew install git

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

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

brew install git

现在,您可以配置Visual Studio Code(版本0.10.2,检查旧版本)以使用现有的Git安装。

只需在Visual Studio Code设置(菜单File→Preferences→settings)中添加Git可执行文件的路径,如下所示:

{
    // Is Git enabled
    "git.enabled": true,

    // Path to the Git executable
    "git.path": "C:\\path\\to\\git.exe"

    // Other settings
}

Windows 10操作系统:

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

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