Not Your Dad's IT

Updated Solutions to Classic Challenges

A personal website dedicated to helping IT professionals review where we've been, where we are, and maybe where we are headed.

  • Blog
  • About
  • Disclaimer
VSCode_Logo_01.PNG

Visual Studio Code Error - "There are no active source control providers"

March 27, 2018 by Nathaniel Avery in Bugs, Tip

After months of using Visual Studio Code on Windows 10, connectivity to my Git repositories vanished.  I did some research and was pretty sure I'd uncovered a flaw. I upgraded to version 1.21.1, but I also added several new extensions.  It seemed entirely possible that any of these actions, or some combination of them triggered a bug.

I'd even found forum posts that indicated I should try setting my git.path information.

Changes made to files using Visual Studio Code would not be reflected in my Git repository without proper connectivity.

Git_Path_Missing_v7.PNG

The truth is, I was using the app incorrectly.  Let me explain.

In addition to the upgrade and extensions added, I also closed all of my workspaces.  It turns out, that the option for connecting to a Github repository only appears when using a workspace.

I was clued into my problem, by reading the errors in the Output Terminal for Git.  Visual Studio Code was running Git and issuing commands.  Because it issued commands, the path couldn't have been the issue.

The real culprit was revealed in the error.  "fatal: Not a git repository (or any of the parent directories)."  When I reviewed each of my old workspaces, they had .git files in them.

Git_Path_Missing_v4-2.png

Fix

I corrected the problem by creating a new folder and setting it as the workspace.  To do this. I selected File -> Add Folder to Workspace.  Once the workspace was created, I opened the Source control tab, and the Git options were available once more.  This was evident by the Git symbol next to the ellipses.

Git_Path_Missing_v5.png
March 27, 2018 /Nathaniel Avery
Visual Studio Code, Git
Bugs, Tip
  • Newer
  • Older

Powered by Squarespace