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在操作系统更新后丢失,在我的大苏尔的情况下,只是字面上:brew install git

其他回答

我只需要从这个链接https://git-scm.com/download/win为windows安装git就可以了

不需要设置环境变量或路径。

背景: 我已经安装了VS Code,和github桌面,我克隆的回购使用github桌面。

当我打开repo时,使用VS Code,我看到了这个错误。

我通过为windows安装git来解决这个问题。

WINDOWS 10

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

问题出现在IntelliJ Idea和VSCode中。

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

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

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

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

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

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

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

brew install 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代码。