首页 > 解决方案 > Git is not accessible as a source provider from VSCode

问题描述

Can't nail what's missing with Git integration in VSCode (latest 1.23.1) on Windows 10.

Got Git 2.17.0 installed.

Got it in the system-wide Path.

Got this in my User Settings

 {
    "git.enabled": true,
    "git.path": "C:\\Git\\bin\\git.exe"
 }

Git is well visible in the built-in VSCode terminal:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\myself> git --version
git version 2.17.0.windows.1

Still nothing among "active source control providers", and no Git icon available there.

What's wrong?

P.S. None of this

Git missing in VS Code – No source control providers

or that

Visual Studio Code cannot detect installed git

worked either.

标签: gitvisual-studio-codevscode-settings

解决方案


如果工作区中没有存储库,则 VSCode 将显示消息

没有有效的源代码控制提供程序

如果您希望将存储库克隆到您的工作区,您可以使用 VSCode 文档页面中源代码管理克隆存储库Git: Clone部分中描述的命令

或者要初始化一个新的存储库,您可以使用在同一文档的初始化存储库部分中描述的类似有用的Git: Initialize repository命令(顺便说一下,本节描述了您所看到的消息)。然而,这在内置源代码控制选项卡的右上角有一个匹配的按钮。

如果您还不知道,可以使用键盘快捷键访问命令面板:

Shift/ Cmd+P

或者

F1


推荐阅读