107

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

46 Answers 46

119

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 "@builtin git".

Click the gear icon by Git, and click disable.

Then click it again, and click enable.

Here is a screenshot reference

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

10 Comments

Aren't those just the best (worst) days? Just to check; Was your source control showing literally nothing, or not reflecting changes?
@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..
For this to work, after disabling the Git extension, you may have to restart or reload VS Code before enabling it again.
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)
Thank you. This worked for me. Tip: if you don't find the "built-in" filter, just disable and enable all extensions.
|
96

Open your project with cmd.

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

It worked for me

9 Comments

Weird that code . didn't work and the -n new worked. Thanks!
But when I make a change it doesn't seem to reflect it, only seems the diff was ran once at startup.
it works but can you elaborate?
-n Opens a new session of VS Code instead of restoring the previous session. So my guess is that there was something cached in the session that was causing this to break.
I had to restart the system, as it didn't work just with the commands. Then used the above commands, worked .
|
45

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

1 Comment

Thanks for the tip. I had to uncheck then check Source Control for the changes to reappear.
24

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

1 Comment

Interesting, that "worked". Would be great to know what the difference is 😀
11

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.

2 Comments

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.
my gosh finally. I had to disable most of my extensions. I'm not sure which one was messing it up (yet)
9

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

2 Comments

Probably related to this bug: Git: Symlink support #5970
Gosh you saved me dude!
7

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.

1 Comment

you saved my day! simple but working solution. Thanks
7

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.

2 Comments

worked nicely! VSC bug!
only thing that worked for, very strange issue!
5

Possible duplicate

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

2 Comments

This showed me where the "Source Control" section was. Then I dragged it to the "Source Control" tab. Thanks!
thanks, worked for me too seems the source control option was actually hidden
5

Ensure that you have saved your changes in the files you are working on. Visual Studio Code won't detect changes until the files are saved.

So just make sure that you have Auto Save enabled (File-> Auto Save)

1 Comment

This worked after trying all of the above solutions, thanks!
4

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

Comments

4

Unticking and re-ticking these options will show the changes:

click to view settings

click to view settings

Comments

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.

Comments

3

One day one of my projects suddenly stopped showing files and it was this issue for me.

enter image description here

Comments

2

Close vs code and open it again. This worked for me.

Comments

1

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.

1 Comment

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.

Comments

1

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

File > Auto Save (check)

Comments

1

In setting check Git: Autorefresh

Comments

1

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.

Comments

1

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

3 Comments

Can you add more detail as to what you mean by steps 3 and 4?
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.
This is the only answer that worked for me.
1

Not much of suggested anwers helped expect the below:

  1. In extensions type @builtin git. Disable all Git extensions, restart, re-enable.
  2. Search for git parent in settings. Set "Open Repository in Parent Folders" to always.

Comments

1

Running in a devcontainer working with files did not get picked up by the explorer.

[ctrl + shift + p]

Developer: Reload Window

This fixed it for me.

Comments

1

I tried everything and the problem in my case was resolved as:

  1. If a repository is already listed under Source control Repositories then click on it.

  2. select Close Repository

Now you can see initialize repository and publish to github option.

  1. select Initialize repository

  2. Type in the new repository name

  3. Choose whether you want it as public repository or private repository

  4. Now all your files will appear below source control.

  5. Stage and commit all changes

  6. Publish to github.

Comments

1

So i have checked enter image description hereseveral answers and tried almost all of them but couldn't find any proper solution at the i disabled all the git extensions that i have and found the GitLens was the issues so if any one having the same issue while having gitlens in your vs code try disabling and restarting the vs code i am attaching image of version that i was using and i tried to update to pre release didn't fixed the issue so at the end i had to disable it.

Comments

1

I was facing the same problem, at first, I tried to save code and it started appearing in version control. to get rid of manual saving every time, you can toggle autosave from file>Auto Save.

1 Comment

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.
1
  1. Close VSCode
  2. rename problematic repo folder
  3. Open renamed repo folder in VSCode

This fixed it for me. Seems to be an issue with some cache getting corrupted probably.

This seems to re-create some folder-specific VSCode cache for the repo. I only have this problem when the specific repo-folder is named in a specific way.

1 Comment

Thank you for your interest in contributing to the Stack Overflow community. This question already has quite a few answers—including one that has been extensively validated by the community. Are you certain your approach hasn’t been given previously? If so, it would be useful to explain how your approach is different, under what circumstances your approach might be preferred, and/or why you think the previous answers aren’t sufficient. Can you kindly edit your answer to offer an explanation?
1

I tried several solutions, such as restarting, uninstalling and reinstalling VSCode, and removing and reinstalling the extensions, but none of these worked for me.

The solution is to delete the cache for VSCode

Through the following path
On Windows: C:\Users\YourUserName\AppData\Roaming\Code

On Mac/Linux: ~/.config/Code

Comments

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.

1 Comment

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.