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?
当前回答
以下是对我有效的方法。不要使用Visual Studio Code终端来运行Git命令,而是从应用程序路径下的cmd终端运行Git命令。
其他回答
以下是对我有效的方法。不要使用Visual Studio Code终端来运行Git命令,而是从应用程序路径下的cmd终端运行Git命令。
在将macOS更新到Ventura后,我也遇到了同样的问题!
我使用下面的命令,它为我工作!
git --version
确认你是否已经安装了git,如果没有运行
brew install git
安装最新版本。
安装成功后,运行
brew link git
如果它不能符号链接,因为目标已经存在,你可以运行
brew link --overwrite git
覆盖它。
希望这对你有用!
Visual Studio Code只是在PATH中查找git。为了简单起见,许多UI客户端附带了“可移植Git”,并且没有将Git添加到路径中。
如果您将现有的git客户端添加到您的PATH(以便它可以找到git.exe), Visual Studio Code应该启用git源代码控制管理。
我只需要从这个链接https://git-scm.com/download/win为windows安装git就可以了
不需要设置环境变量或路径。
背景: 我已经安装了VS Code,和github桌面,我克隆的回购使用github桌面。
当我打开repo时,使用VS Code,我看到了这个错误。
我通过为windows安装git来解决这个问题。
首先在桌面上安装Git,然后在Visual Studio Code中添加包围的扩展,如图所示。
帮我解决了和你一样的问题。
推荐文章
- 打开同一目录两次
- 如何从终端/命令行调用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拉另一个分支