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?
当前回答
OS X更新后,我必须运行xcode-select——install才能让GitLens工作。
其他回答
对我来说有用的是在我的系统中手动添加路径变量。
我遵循了这篇文章中的方法3:
https://appuals.com/fix-git-is-not-recognized-as-an-internal-or-external-command/
如果git在操作系统更新后丢失,在我的大苏尔的情况下,只是字面上:brew install git
Visual Studio Code只是在PATH中查找git。为了简单起见,许多UI客户端附带了“可移植Git”,并且没有将Git添加到路径中。
如果您将现有的git客户端添加到您的PATH(以便它可以找到git.exe), Visual Studio Code应该启用git源代码控制管理。
三年后,我遇到了同样的问题。在用户设置& path环境变量中设置路径没有帮助。我更新了Visual Studio Code,这就解决了问题。
OS X更新后,我必须运行xcode-select——install才能让GitLens工作。