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?
当前回答
对于基于linux的操作系统:由于路径损坏,我遇到了这样的问题,但我能够暂时修复这个问题,我的Git安装立即恢复。
如果您遇到这样的路径问题,请键入下面的命令
export PATH="/usr/bin:/bin:$PATH"
其他回答
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来解决这个问题。
我在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没有安装在您的系统上”错误。
在升级Xcode后,我在macOS v10.13.5 (High Sierra)上遇到了这个问题。
当我运行git命令时,我收到了下面的消息:
同意Xcode/iOS许可证需要管理员权限,请运行" sudo xcodebuild -license ",然后重试此命令。
运行sudo xcodebuild -license命令后,出现如下消息:
您没有同意Xcode许可协议。你必须同意以下两项许可协议才能使用Xcode。 按Enter键查看“/Applications/Xcode.app/Contents/Resources/English.lproj/ license .rtf”中的许可协议
输入Enter键打开许可协议,并输入空格键查看它的详细信息,直到出现以下消息:
输入“同意”即表示您同意软件许可协议的条款。输入'print'打印它们或者其他任何可以取消的东西,[同意,打印,取消]
最后一步是输入agree以签署许可协议。
输入git命令后,我们可以检查Visual Studio Code是否再次检测到git。
以下是对我有效的方法。不要使用Visual Studio Code终端来运行Git命令,而是从应用程序路径下的cmd终端运行Git命令。