Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No source control providers registered - How to register SCM in visual code on mac?

I see there are several questions about having no active source control providers in VS code. I get a slightly different error:

No source control providers registered

I am on a mac with a recent both OSx update to Mojave (10.14) and a new version of vscode (Version 1.28.2).

I don't have xcode installed on my machine.

I want to use github.

How can I solve this problem?

enter image description here

like image 445
Brainmaniac Avatar asked Oct 24 '18 11:10

Brainmaniac


People also ask

How do I fix no Source Control providers registered?

I opened a git repo by VS Code, but it shows No source control providers registered . One possible reason is that VS Code couldn't find the executable git command, so we can set the executable path of git in settings. Open File -> Preferences -> Settings , then find the Git: Path setting, click Edit in settings.

How do I enable Source Control in VS Code?

Launch VS code, and in the left-hand menu, click on the Source Control icon for Git. It gives two options – Open Folder and Clone Repository. We can open a git repository folder or clone from a GitHub URL. We already set up a GitHub repository in the previous article.

Why is Visual Studio not showing Source Control?

If you don't see the checkbox for adding to source control – Git or Visual Studio Team Services, you can enable this from Options settings. From the main menu, Tools -> Options and then navigate to. Under the Plug-in Selection, you will find it is already set to “None.

How do I use VSC on Mac?

Drag Visual Studio Code. app to the Applications folder, making it available in the macOS Launchpad. Open VS Code from the Applications folder, by double clicking the icon. Add VS Code to your Dock by right-clicking on the icon, located in the Dock, to bring up the context menu and choosing Options, Keep in Dock.


5 Answers

This video worked for me. Really weird. But somehow I seem to have disabled my builtin git extension. https://www.youtube.com/watch?v=nFzQnl44_70

like image 134
kaun jovi Avatar answered Oct 13 '22 18:10

kaun jovi


I had this issue on Mac OS and I found that I had to go into Code > Preferences > Settings. Search for Git and then Scroll down until the Entry for Git: Path is found. Click edit in Settings. Follow the instructions.

I found the path to Git in a terminal

# which git
/usr/local/bin/git

Add to the end of the override file (in the right hand window of the VS Code settings editor, "" included.)

"git.path": "/usr/local/bin/git",

Now Git works.

like image 21
Ben Castan Avatar answered Oct 13 '22 17:10

Ben Castan


Try disabling all extensions, reload, reenable all extensions, reload. I had this issue and re-installed vscode, re cloned my project, and still was getting the error of no source control providers registered. But when I disabled all my extensions, then reloaded, then reenabled, the reloaded it fixed my source control.

like image 34
yabna Avatar answered Oct 13 '22 19:10

yabna


I found this question because I was having a similar problem with my vscode + mercurial extension.

My windows is setup as a portable install and mercurial is in one of my conda environments so hg.exe was not found automatically by the extension. I set hg.path = [path to hg.exe"] in my case this line as added to my user settings json file (File->Preferences->Settings, then search for git.path and click Edit in setttings.json):

"hg.path": "C:\Users\myname\anaconda3\envs\py27merc\Scripts\hg.exe"

An equivalent path on the path might be something like "/usr/local/bin/hg" depending how mercurial is installed on your system

git has a similar variable and if you have git installed in fashion so that it cannot be found automatically you might need to set it manually in a similar way like:

"git.path": "/usr/local/bin/git"

assuming that /usr/local/bin/git is where your git executable is located

like image 39
user1228770 Avatar answered Oct 13 '22 19:10

user1228770


One that helped me with this issue (in addition to adding "git.path": "/usr/local/bin/git"):

  • In your settings.json search for "git.enabled": false and set to "git.enabled": true
like image 26
twknab Avatar answered Oct 13 '22 19:10

twknab