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,然后在Visual Studio Code中添加包围的扩展,如图所示。
帮我解决了和你一样的问题。
其他回答
对于MAC
首先,类型
git
在终端中,看看你得到了什么错误。
然后:
如果错误与命令行工具有关!
Run:
xcode-select --install
And
我们来看看这个答案,尤其是Mac。对我来说很容易。
https://apple.stackexchange.com/a/254381
Windows 10操作系统:
我的问题是我在管理模式下使用PowerShell克隆了存储库。当我不在管理模式下启动PowerShell时,VS Code可以检测到Git回购。
我在升级到macOS v10.15 (Catalina)后遇到了这个问题。
问题解决方法如下:
1.
从终端找到Git的位置:
which git
2.
在设置文件中添加Git的位置和你的位置:
settings.json
"git.path": "/usr/local/bin/git",
根据你的平台,用户设置文件(settings.json)位于这里: Windows % APPDATA % \ \用户\ settings.json代码 macOS $HOME/Library/Application Support/Code/User/settings.json Linux $ HOME / config /代码/ User / settings.json
WINDOWS 10
没有什么能帮我摆脱困境。
问题出现在IntelliJ Idea和VSCode中。
VSCode中的Git选项卡让我Init存储库-它没有检测到工作区中有一个. Git文件夹。
当我在VSCode中从控制台执行git拉时,它要求我通过web浏览器添加凭据。在我登录后,git问题被修复,所有的插件开始工作。 我需要为每个克隆的存储库这样做,即使我在git克隆期间使用了正确的凭据…命令。
Ps.我在Windows上使用CMD通过HTTPS从Gitlab克隆了存储库。VScode使用Powershell -这可能是原因。
对我来说有用的是在我的系统中手动添加路径变量。
我遵循了这篇文章中的方法3:
https://appuals.com/fix-git-is-not-recognized-as-an-internal-or-external-command/
推荐文章
- 打开同一目录两次
- 如何从终端/命令行调用VS代码编辑器
- 为什么我需要显式地推一个新分支?
- 如何撤消最后的git添加?
- Rubymine:如何让Git忽略Rubymine创建的.idea文件
- Gitignore二进制文件,没有扩展名
- Git隐藏错误:Git隐藏弹出并最终与合并冲突
- 了解Git和GitHub的基础知识
- 没有。Git目录的Git克隆
- Git与Mercurial仓库的互操作性
- 忽略git中修改(但未提交)的文件?
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- 如何在Visual Studio代码中重置设置?
- Git拉另一个分支