154

I just installed Visual Studio Code 1.17 and opened a Git repository folder. When entering the Source Control tab I see a message "There are no active source control providers". I thought Git was baked into VSCode!?

To make matters worse, when I attempt to install additional SCM providers there is no option for Git. How do I get my Git back!?

Visual Studio Code, displaying “No source control providers”

10
  • 3
    Hmmm, I get "Source Control:Git". Maybe restart VSCode to see if it fixes it? Commented Oct 6, 2017 at 15:44
  • restart did not fix it. Commented Oct 6, 2017 at 16:02
  • 1
    Can you try clicking on the overflow menu (the three dots) in the source control panel and choose “Switch SCM Provider” there, to select Git? Commented Oct 6, 2017 at 17:29
  • Can you post a screenshot of what you can see in the Source Control tab, @ChiliYago? Commented Oct 6, 2017 at 19:48
  • i'm having the same issue. environments: windows 10 i tried all the solutions above, but does not work. then, there's a official update coming, the git is present after completing the update. hope it will helps. Commented Dec 21, 2017 at 1:37

46 Answers 46

138

Wow I spent so long on this. For me I had to go to the Extensions area > then click the ... at top right of menu > Show built-in Extensions

Git built-in extension was disabled!!

screencapture

For MacOS users, there isn't any "Show built-in extensions" option.

  1. Just search @builtin git in the Extensions search box.

  2. Then Enable Git from the Git extension settings.

Answer by @carpiediem in the comments.

Sign up to request clarification or add additional context in comments.

5 Comments

I'm on MacOS with VSCode. 1.52.1. There was no "Show built-in extensions" in the menu, but searching for "@builtin git" did the trick. I was able to click the gear icon and enable.
Update May '21: Click the Extensions icon > Menu ( ... ) > Views > Disabled (ensure this is checked). Then on the Extensions panel, I was able to right click the Git extension and enable it.
I needed to do both @johnwp 's answer and this to make it work.
I didn't see the option on the '...' menu, but the command palette CTRL+SHIFT+P showed it when searching for 'Built-in'
Winner Winner Chicken dinner! Thank you!
67

Are you using MacOS? If you've updated Xcode lately, you may need to accept Xcode's terms of service agreement to use git.

$ sudo xcodebuild -license accept

10 Comments

This question is about VSCode, not XCode.
@ifconfig: the question might be about VSCode but the answer is absolutely valid and correct, you need to accept Xcode's terms of service agreement in XCode to use git in VSCode (at least I had to, so this was the answer I was looking for)
After updated Xcode my git in VS code is not working anymore. This answer is very helpful!!
That command returns: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
worked for me. I ran the command, then reopened VS Code and then command+Shift+P -> Git:Clone, and it worked as expected.
|
38

What helped me is setting the value of git.path setting to the full path of my git.exe file. After that I was able to see the git logo:

git icon

14 Comments

OP mentioned in a comment, that git is in the PATH and can be used from the Windows command line. Setting git.path is only necessary if that wouldn’t be the case.
@poke still worth a try, since git being on PATH doesn't work for OP. Also useful for people who don't want git on PATH
Sure, I’m just saying that if this ends up working, OP lied to me ;P
This does not work for me. 1st I´m not on windows, 2nd: if I add "git.path": "/usr/local/bin/git", to the settings it says: Unknown configuration setting, so where did you set this variable?
Late to this party but... @Macilias any issue with "git configuration" refers to the ~/.gitconfig file. For example, bad syntax. Refer to the git-scm docs for help with that, but sometimes looking at the file you will see something obvious or a typo so try that first.
|
25

I had this too. tried overriding the default git.path setting but that didn't work. What seemed to fix it for me was opening an existing repository .. just an empty folder that I created and did a 'git init' in at the command prompt. After I opened that folder I could click the Source Control button and it had all the git functions available and no longer said "There are no active source control providers". Furthermore, doing File->Close folder got me back to where I started. Another way was to click the small "branch" button ABOVE that message ("There are no active ...") and initialise a repository. This message is very confusing!

2 Comments

On Windows, with a fresh installation of Git and VS Code, using all default settings, this is the correct answer. The 'No Source Control Providers' message refers to the current workspace and not the application. See also: github.com/microsoft/vscode/issues/61491
me2. Had been breaking my head over this, until I found this answer. Opened a directory containing a working copy that had previously been cloned by Sourcetree, and the git sidebar just started working.
16

Visual Studio Code does come with in integrated Git source control provider. However, in order for that to work, Git itself needs to be installed on your system as well. So just download and install Git on your machine, and Visual Studio Code will also be able to use it.

While the source control panel does not tell you this, but unfortunately just stays quiet about it, not offering anything, there is a way to have VS Code tell you this: On the “Welcome” page that is displayed when you start the application, there is a link “Clone Git repository…”. If you click there, VS Code will tell you that Git is missing:

It looks like Git is not installed on your system

Once you have installed Git and restarted Visual Studio Code, you will see a small Git icon at the top of the source control panel (unless you already have a repository opened of course):

Source control panel with a Git icon

This will tell you that Git is there and you can click the icon to initialize a repository—or just open an existing repository.

2 Comments

I have Git installed on my machine. Git status on the command line works just fine. I did mentioned that I am opening a git repository.
Is Git in the PATH? Can you run Git commands from the Windows command line?
16

Open Visual Studio Code, click left-bottom ⚙️ (gears) and select Command Palette.

Search for the word "enable", and select Enable All Extensions.

Comments

14

For me, the solution was (on Mac) Code > Settings > User Settings > Extensions > Git

Check the (unchecked) box next to Enabled - Whether git is enabled.

Git enabled setting

2 Comments

In my vs code there is no Git, what can i do? @Brian Cragun
It's Enabled. But Still Doesn't Work.. :(
12

Simplest steps what worked for me:
1. Download and install Git on your machine as mentioned in Poke's answer.
2. Restart VS Code.
3. Open Command Prompt (Crtl+Shift+P) and write 'Git: Initialize Repository' and choose a folder you like (it can be even a temp folder).
4. Finally Git logo appears as shown in Torvin's answer and then its easy to set up your git account and start using it.

1 Comment

This worked for me on my mac. I initialized a folder and then bam, it all worked.
12

Enter the Add-ons field in VS Code and; @builtin git write. For Example

enter image description here Then enable it.

1 Comment

when you add @builtin git you also need to download git from git-scm.com/download than connect with github easily.
10

You need initialize (git init in terminal) your project/folder, that your VS Code to be able to see his as git-project.

Enter in your project/folder through terminal

cd ~/ImbaFolder
git init (it created .git file - the git repository)

Then your VS Code will to see that it is git repository, and it will works.

1 Comment

Closest match. Checked out code - aka Cloned repo - to local folder via Git for Windows. Right-click Opened folder with VS Code. Finally the Source Control area was alive.
8

If this helps; I did face the same issue with the latest version of VS Code and tried all the mentioned tips, but no luck. Finally, I added a folder to a workspace, saved that workspace, and then when I checked the repo icon, could see the small git icon and can as well clone a repo from the command palette.

Raised an issue for this and commented the same findings. Can be found here https://github.com/Microsoft/vscode/issues/49469

Comments

7

So, I tried all sorts of things to get this to work. I tried "git.path": "/usr/bin/git", adding git directly to my path, etc. Nothing worked.

Finally, I realized that in my VSCode workspace settings, I had "git.enabled: false". I changed it to true, and it works like a charm.

3 Comments

actually "git.path": "/usr/bin/git" was the fix for me
where to add this path?
To know the path of the location of Git, you can run which git, and it will return the exact location of your Git folder. Then simply paste it on the settings config.
7

My plugin was disabled, just enabled it.

  1. Go to extension(click on the extension icon on the left),
  2. Serach for @builtin git,
  3. Enable the git default built in extension,
  4. It started to work for me again.

1 Comment

Worked when using vs code with WSL (ubuntu)
7

That is because the built-in git is disabled in your vs code either because of installing any git package or you accidentally disable it.

For enable it

  1. Go to vs code.
  2. Open extensions and search for @builtin git.
  3. Now you will see a git extension in it.
  4. Now click enable if it is disabled.
  5. And visit source control. You will see the clone repository

Comments

6

So I tried nearly every answer and nothing.

  • Re-install Git
  • Initialize an empty repository locally with git init
  • Checked to make sure the @builtin git was enabled
  • Restart VS Code multiple times

I ended up trying Ctrl + shift + G and noticed a command at the bottom of VS code.

enter image description here

All I did was press the G key and the icon suddenly appeared and everything works perfectly!

Comments

5

Try xcode-select --install. In macOS git is attached to XCode’s Com­mand line tools

5 Comments

The question is not about Xcode. It’s about Visual Studio Code.
@poke and that is exactly what fixed my vscode "There are no active source control providers" issue! You need to do it if you have just updated your mac fx.
The question at no point suggested the operating system that was being used. Now, there is a screenshot obivously showing a Windows system, so your answer does not really help.
This answer really helpful when MacOS update to High Sierra version.
I've tried changing the "User Settings" in VSCode on Mac and it will not work. However, this solution worked because "Developer Command Line Tools" isn't installed on a Mac, Windows (10) simply needs Git installed.
4

Tested in VsCode on Windows dev PC.

What worked for me was to enter Settings by hitting Ctrl + , at least on my machine and then enter the following setting: SCM.provider.AlwaysShowProviders

Then just ticked the checkbox and Git was lighting up again and I could then go to Source Control by Ctrl+shift+G.

1 Comment

"Ctrl+shift+G" worked. Apparently, unlike other buttons like explorer, search clicking on the git(SCM) button completely removes it.. Ctrl+shift+G brings it back
3

Since i installed GIT in custom defined path, i needed to reference it inside settings.json

( F1 > settings.json > enter )

Add setting:

"git.path": "<custom path to git.exe>"

Wich in my case made it look like:

{
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
    "git.path": "<custom path to git.exe>"
}

Right after it worked perfectly.

1 Comment

Works perfekt! Thanks. After entering "settings.json" in the search field, I choose "Preferences: Open Settings (JSON)". Nice hint to use F1 (works like Strg+Shift+P).
3

For future prospects, if anyone is facing a problem like mine. This may be a solution.

Right-click and enable the option.

1 Comment

Settings -> git.enabled, which can easily open up by Ctrl+Shift+G. It's quite curious that in @builtin git says enabled globally, but the label is not present and the feature is not enabled. Must be explicitly in the settings.
2

I found that VScode stopped tracking after I checked out a different branch (new one). What solved it was simply:

  • Closing the working folder.
  • Reopening the folder.

VSC then synced with the new branch and showed the differences.

Comments

2

I ran into the same problem and figured out that VSCode does not recognize git repo unless it is added to a workspace.

So, add the folder you want to be tracked via Git into a workspace and git will be enabled automatically.

1 Comment

What do you mean by workspace? If I open the folder that has git, it still doesn't work.
2

I did not see the Git controls until I created a file and saved the current workspace - suddenly "Source Code Control" showed the Git Icon and I could initialize a new Git repo.

Cloning an existing repo seems to be unsupported in VS Code, and I guess that is the reason that Git controls are hidden until there is a workspace where a new repo can be initialized.

Comments

2

Scenario: For MAC + issue afer installing/updating xcode:

Can also happen when you install xcode and yet to accept the license terms. To accept the terms, just run the below.

sudo xcodebuild -license

Post to this restart VS code & you are good to go.

1 Comment

I had the same problem but I made a system update and after that everything was fine.
2

Solution For Mac Users

This is simple way and this way has been solved my problem on Mac:

1) Run this command on console :

sudo xcodebuild -license accept

2) Close Visual Studio Code and reopen it.

That's it.

Note : If you are using MacOS and you have updated your Xcode recently, you may need to accept XCode's terms of service agreement to use git.

2 Comments

What does this do? Seem like this command is a catch all for acceptance of any license, which seems very dangerous, can you please clarify?
Hi Jason Foglia. This solution for MacOS users. If you have updated your Xcode recently, you may need to accept Xcode's terms of service agreement to use git. (Also it was described here by johnwp: stackoverflow.com/a/46610954/5736731 )
2

I just fixed this problem. I newly installed VS Code and this problem occurs.

OS: Ubuntu 18.04.2

On my source control tab, it shows "no source control providers registered".

Here's how I fixed this problem.

  1. Edit the setting file, set the gitpath to /usr/bin (my git dir)
  2. Run git init command in my project folder
  3. Press ctrl+shift+P and run "reload window" command

And this problem is fixed.

Comments

2

I incidentally dragged the git icon to the search panel, just drag it back to solve the issue.

Comments

1
  1. If SCM view is empty you need to install a source code provider.

  2. Check Extensions (Ctrl+Shift+X) under View and select the SCM provider you want. Start typing @ca and you will see extensions listed. Select @category: “scm providers” to see available SCM providers.

  3. If you don’t see Git here you need to install Git. Here’s their download page for windows. https://git-scm.com/download/win

  4. After installing you’ll see Git Extensions for VS Code listed under Extensions view. Select it and click install on the right hand side panel that appears.

  5. After installing the SCM remember to close and reopen VS Code.

Comments

1

The reason for this problem is that Git is not initialized in the folder that you are trying VS Code to open (this is for Windows 10).

  • Install Visual Studio Code from https://code.visualstudio.com/download
  • Install Git from https://git-scm.com/
  • Create a folder named git in: C:\Users\YourName\ so it will look like this C:\Users\YourName\git (<-- you can pick any directory)
  • While you are in that folder, right-click > Git GUI Here > Create New Repository
  • In pop-up window Browse for the folder you just created (to initialize Git there) > click Create
  • This will create a .git file in that folder
  • Open VS Code > File > Open Folder > (select the folder you just initialized Git at)

Comments

0

Adding another solution in case someone like me runs in to this again.

I had just setup a new node project and I was getting this. I had to create a .gitignore file and add node_modules to it and then vscode looked correct. From what I can tell it might be because there are other git repos in the my node_modules and vscode was seeing those as well. Not sure the technical reasons but that seems to have fixed it for me.

Comments

0

I see that Cygwin isn't mentionned here. It happened to me and I found the solution https://github.com/Microsoft/vscode/issues/7998#issuecomment-245356777.

If you are using Git from Cygwin.From Windows terminal, execute the following command :

> cd c:\
> md cygdrive
> cd cygdrive
> c:\ - mklink /j "c" c:\

(Assuming that git is stored in the following folder : C:\Cygwin\bin\git.exe)

Now, restart VSCode

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.