2

My Ubuntu installation of the VS Code editor states it has no active source control providers:

No source control

I'm using Ubuntu, and running

$ git --version

indicates it is v2.18.0

There is a .git folder in my project.

How do I fix this problem?

tehhowch
  • 9,645
  • 4
  • 24
  • 42
IceRevenge
  • 1,451
  • 18
  • 33
  • 1
    Can you confirm this - open VS code using `code .` in the directory where git status says that a repo exists, and check for source control again? I just `git init && code .` and VS code recognizes the empty repo. – snugghash Jul 29 '18 at 17:24
  • How do I find that directory? – IceRevenge Jul 29 '18 at 19:41
  • Sorry, I wasn't being clear. Navigate to the directory of your project under git (`git status` will work, if that's the case) and execute `code .` to open it as a project in VS code. Alternatively open that folder (after verifying that `git status` works) using `Open folder` in VS code's file menu. If both are true and it still doesn't work, that means something non-trivial is wrong, imo. – snugghash Jul 29 '18 at 20:50
  • 'git status' worked in my core project folder. When I enter 'git init' it tells me _reinitialized existing Git repository in /myProject/.git_ Now the .git folder has some files in it but VS Code still says _There are no active source control providers_ – IceRevenge Jul 29 '18 at 23:38
  • Seems like an git installation error? – IceRevenge Jul 30 '18 at 00:06
  • Interesting. The git command line tool itself seems to be working fine (at least superficially), either VS code or some integration seems to be broken. Unfortunately I'm not knowledgable enough to debug this further. Ask in chat perhaps, about how to gain more information. – snugghash Jul 31 '18 at 06:56
  • Hmmmm... not able to create a chatroom yet. Cant even chat... dont have enough reputation :/ sucks – IceRevenge Aug 01 '18 at 12:24

1 Answers1

1

Two other answers explore setting the path to the git executable in VS Code here and originally here and others. Apparently in Windows this is necessary. (As opposed to linux where the git.path is null, but perhaps git is called from PATH)

To reiterate, please verify that your settings in VS Code (File -> Preferences -> Settings or F1 (Open command palatte) -> Settings) contains the following somewhere:

{
    // Is git enabled
    "git.enabled": true,

    // Path to the git executable
    "git.path": "C:\\path\\to\\git.exe"
}

Note that you'd have to change settings in the right hand window, which override the default ones in the left hand one.

snugghash
  • 450
  • 3
  • 13