57

Visual Studio Code source control panel is empty when I click on it. Nothing to expand and nothing to click on.

Things I've tried:

  • Uninstalled/Reinstalled Git
  • Uninstall/Reinstalled VS Code
  • Removed extensions folder
Post Impatica
  • 14,999
  • 9
  • 67
  • 78

31 Answers31

63

Open your project with cmd.

> cd your-folder-location
> code . -n

It worked for me

zenTheo
  • 786
  • 6
  • 3
46

Lost an hour because my SCM in VSCode stopped showing anything today. I restarted everything, tried git init, everything on the forums. Made sure Git built in extension is enabled, mine was already enabled so I was totally lost.

All I had to do was disable and then reenable the built in Git extension. and it fixed it.

Go to Extensions.

Filter by "built in".

Click the gear icon by Git, and click disable.

Then click it again, and click enable.

Here is a screenshot reference

Amanda Simonds
  • 461
  • 4
  • 5
  • Aren't those just the *best* (worst) days? Just to check; Was your source control showing literally nothing, or not reflecting changes? – Dylan Lacey Dec 13 '21 at 02:18
  • @DylanLacey Literally nothing, says "The folder currently open doesn't have a git repository," even though I can check git status and make commits in the terminal. its showing nothing right now - seems like I have to disable and reenable the Git extension every time I open VSCode now.. – Amanda Simonds Dec 13 '21 at 15:47
  • 4
    For this to work, after disabling the Git extension, you may have to restart or reload VS Code before enabling it again. – manisar Feb 02 '22 at 19:05
  • 3
    ahhh, I tried every single solution above and this is what did it for me too, thank you. fwiw the filter is now `@builtin`; here it showed two git extensions: "Git" and "Git Base" - disabling the first and reloading is what did it (and it is still disabled) – Pedro Aug 17 '22 at 17:59
  • Thanks! None of the above solutions worked for me, but this one did. – Papyrus Sep 06 '22 at 14:57
  • 1
    Thank you. This worked for me. Tip: if you don't find the "built-in" filter, just disable and enable all extensions. – Fernando Souza Jan 26 '23 at 12:09
  • Saved my day! work as a charm – Hoang Speed Feb 16 '23 at 09:04
21

In my case, somehow, the Source Control Repositories option, available under the 3 dots ... on the SOURCE CONTROL tab, was no longer selected.

All I had to do was press the ... and select Source Control Repositories, then select the correct repo, and all the changes were again listed.

SOURCE CONTROL

Telmo Dias
  • 3,938
  • 2
  • 36
  • 48
14

I had a similar issue. It seems vs code has two source control extensions. When I clicked View -> SCM it opened an extension with changes displaying.

source control extension 1

enter image description here

source control extension 2

enter image description here

8

I had this problem 2-3 times for the last 2 years (OS -> Linux Mint). The changes on any file didn't appear to the source control nor have they been marked on the line I've edited. When manually go to "Source control" and click on the refresh button they appear but the lines that I had change didn't light up (there were no visual marking on the files after editing them). This happened when I switched to a different branch while the workspace was open to the 2 monitors at the same time. Or when working on several projects (opened 2-3 or more VS Code instances). The scariest thing was that it didn't work not only for one repository(project) but for all of them. I've read alot on the subject and tried everything that I found and think of. There is some issue with git path mapping or something.

The thing that I tried:

  • reload VS Code
  • restarting VS Code
  • disable all extensions
  • enable/disable all git related options in (file -> preferences -> settings)
  • deleting (folders and files) and cloning the repository
  • updating git
  • removing and installing git
  • restarting PC (don't judge me I was desperate)

But the only solution that worked for me was:

  1. open VS Code (if open, don't close it)
  2. go to the directory where you keep your repositories (not from VS Code but from you file explorer).
  3. go one folder above it (if you are in .../{{some folder}}/{{you repos}}, go to ../{{some folder}})
  4. then open you repositories containing folder (/{{you repos}}) by right click -> open with VS Code
  5. wait until everything loads. The Source Control will mark alot of changes, don't worry about it.
  6. then close VS Code (all windows (instances), because it will open a new instance)
  7. after that go to the directory where you keep your repositories again and right click and open with VS code the repository of you choice. Now at this point the Source control will start working properly.
Mkey5
  • 83
  • 1
  • 6
  • This worked for me. Only difference was that I use WSL, and VS Code prompted me to reopen in WSL, which I did, and at last I could see my changes again without having to click the git refresh button every time. – Coder May 03 '23 at 12:38
6

What worked for me was going to my "code" folder where I keep all my repos, right-clicking on the folder containing the repo I want and opening that folder with VS Code.

The VS Code window for this specific repo was closed. I did have another window for a different repo open. As soon as the window opened, the changes showed up in source control and I was able to commit, push and everything else like normal.

Jeffrey Saari
  • 69
  • 1
  • 3
6

I faced this problem when I opened a repo in a directory inside symlink.

My solution: just open this directory in original destination without any symlinks

Nick Lefterov
  • 144
  • 1
  • 6
6

I had the same problem. What I did was:

  • Open another folder with File -> Open Folder...
  • Close the VSC
  • Open VSC
  • Open the original folder with File -> Open Folder...

After this I saw that the source control started loading and my changes came back.

Hope this works for you.

Johols
  • 116
  • 1
  • 4
3

I had this problem in a repository not as a problem from config but because I had a coverage folder with thousands of files not tracked and it seemed to slow the process of checking that out too much.

So I added that folder to .gitignore and it started working again.

nck
  • 1,673
  • 16
  • 40
3

Restating my Vscode And Giving time to load properly Solved my Problem

1

For me, the files were in WSL (Windows subsystem for linux) but I was not opening the folder as such.

in the bottom left, click the green >< symbol, then click "reopen folder in WSL"

VSC remote mode image

presto.

Leigh Boyd
  • 71
  • 1
  • 3
1

In setting check Git: Autorefresh

Serg
  • 55
  • 1
  • 9
1

Possible duplicate

TL;DR : For mac CTRL + SHIFT + G worked

0

I couldn't see any changes in while trying git status. I opened changed files in text editor and they were not changed either. That lead me to conclusion that changes can't be seen by the system (and therefore by git).

The Autosave option was disabled, simply saving the changes helped.

That was my beginning with VSC, in Pycharm never had such problem.

Daniel R
  • 140
  • 1
  • 10
  • related: [Why don't other programs see the changes I made to a file in VS Code until I save those changes?](/q/76984829/) – starball Aug 26 '23 at 22:17
0

I fixed this issue by toggled-on the AutoSave feature in VSCode via File > AutoSave. I noticed that the badge on the github does not show up until the file is actually saved first.

Robie
  • 110
  • 1
  • 3
  • related: [Why don't other programs see the changes I made to a file in VS Code until I save those changes?](/q/76984829/) – starball Aug 26 '23 at 22:17
0

I had this problem, because I was changing files one folder down from where I opened Visual Studio Code.

Solution- open Visual Studio Code without a location, File/Open Folder - open the folder I am directly working out of.

Unstaged changes now show in the direct folder I'm working in. Unstage changes previously auto-staged by Visual Studio Code when working on a nested project directory to see them (open a Terminal and run git reset).

0

I encountered the same issue, and I fixed that by removing the files.watcherExclude property in settings.json file. Because the value of files.watcherExclude became { "**/**/*": true } somehow.

// settings.json
 
// remove or comment next line
// files.watcherExclude: { "**/**/*": true }
zixiCat
  • 1,019
  • 1
  • 5
  • 17
0
  1. Go to View -> Terminal
  2. cd to root folder, and run git status and see if you have any errors

I had a unsafe repository fatat error, as my repo was on a network drive. Did as suggested by git to add an exception and it fixed the issue.

Manpreet
  • 2,450
  • 16
  • 21
0

What worked for me was that I was forgetting to save, so just enabled autosave option.

File > Auto Save (check)

pedro_bb7
  • 1,601
  • 3
  • 12
  • 28
0
  1. close vscode
  2. moved local Code config folder as backup (~/.config/Code/)
  3. reopen vscode (this will still show problem)
  4. close and reopen vscode (this will show db re-write issue but it will re-create config folder.)

this solved my problem. this reset many of my settings but It can be checked from config backup.

0

I experience this problem when I right click a folder and open it up with VS code. Instead now I start VS code from the start menu and after that I use File -> Open Folder option.

mustafa candan
  • 567
  • 5
  • 16
0

I experienced this issue with VSCode V1.70.1, all I did is just closing VSCode completely and open a new instance and I could find git changes appears simultaneously as expected.

A.A.
  • 81
  • 2
0

If running into this issue on a Mac, make sure you are running your instance of Visual Studio Code from your Applications folder and not your Downloads folder. I managed to fire up an instance from the wrong folder and this prevented my Source Control from being able to properly load git info and also caused Visual Studio updates to fail. More on the issue can be found here.

DCaugs
  • 484
  • 5
  • 16
0

Here is another possible solution for Linux users:

In my case, it was only not showing lines changed with the file open. Source control tab was showing fine.

I have a symlink from /var/www to /mnt/{hdd-uuid}/www. When I created my workspace, it was using the path /var/www/project-folder, instead of the full path, and this was giving me the error.

I opened my .code-workpsace file in another text editor and changed the references in the JSON from ../../../../var/www/project-folder to /mnt/{hdd-uuid}/www/project-folder, then reopen VS Code. Close all file tabs open and, when you open again a modified file it will show the lines changed.

It is possible that you need to trust the repo again.

Bruno Polo
  • 657
  • 5
  • 11
0

This worked for me:

  • Click the "More Actions" (three dots at far right of Source Control Dropdown).
  • Choose View & Sort > Repositories > Choose desired repositories.

I don't know how this got disabled in the first place.

Akshat
  • 1
  • 3
0

All the answer dosn't work for me.

My status is VSC show the count of change, but dosn't show the file changed.Finish I find the my self answer.

1.make some change;

2.click the source control commit buttom and commit;

3.undo commit in the commit block;

4.the file changed will show

Deng
  • 1
  • 1
  • Can you add more detail as to what you mean by steps 3 and 4? – ryanwebjackson Jun 15 '23 at 20:47
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 18 '23 at 07:24
0

In my case, all my files is in 'WSL' home directory and I'm using 'Ubuntu' distro to run my application. I was using 'Visual Studio Code' in windows as my IDE. Later I installed 'VS Code' in wsl and put a bat file in windows Desktop to run it with a single click. The bat file contain following line only.

wsl code

Arjun G
  • 2,194
  • 1
  • 18
  • 19
-1

Try opening project or folder which contains git files. Later try opening your wanted folder. This sorted the issue for me.

-1

Double-check git is actually installed on your system. I just did a fresh install of Windows 11 the other day, and although one of the development tools I installed thereafter downloaded and supposedly installed git in Windows, actually, it never installed it. Fail!

John Rix
  • 6,271
  • 5
  • 40
  • 46
-1

I know this is hardcore but it's the only way I got rid of the problem in Ubuntu 22.04: rm -rf ~/.config/Code Then re-open it.

-5

Open Visual Studio code -> View -> Appearance -> Show activity bar