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?
当前回答
在更新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
}
如果git在操作系统更新后丢失,在我的大苏尔的情况下,只是字面上:brew install git
我在Windows 8.1系统下工作的唯一方法是: 添加到系统环境变量(不是用户变量):
c:\Users\USERNAME\AppData\Local\GitHub\ PortableGit_YOURVERSION \ bin \; c: \ \用户名\ AppData \用户本地\ GitHub \ PortableGit_YOURVERSION \ libexec \ git-core \;当地用户c: \ \用户名\ AppData \ \ GitHub \ PortableGit_YOURVERSION \ cmd \
这修复了我的Visual Studio代码上的“看起来git没有安装在您的系统上”错误。
对于MAC
首先,类型
git
在终端中,看看你得到了什么错误。
然后:
如果错误与命令行工具有关!
Run:
xcode-select --install
And
我们来看看这个答案,尤其是Mac。对我来说很容易。
https://apple.stackexchange.com/a/254381
在将macOS升级到Monterey后,我遇到了这个问题。
原来xcode已经在我的mac的新更新中被删除了。只是尝试了以下建议的解决方案:
https://stackoverflow.com/a/52522566/11207358