'Source Control in VSCode is not refreshed automatically

I have updated Mac OS from Sierra to Monterey recently. Since then I have been facing some issues. One of them is in VSCode, when I do changes to the files the changes are not reflected in Source Control or Explorer until the refresh button is clicked manually in Source Control Tab. Can anyone help me out to solve this issue?

I have git 2.16 installed in my machine.
I have updated the version of VSCode and git.autorefresh is set to true.

Update 1:
I have reinstalled git. Now I have git 2.35.1. But still, the Source Control tab is not auto refreshed.



Solution 1:[1]

As Visual Studio Code "Version Control" page mentions:

Note: VS Code will leverage your machine's Git installation, so you need to install Git first before you get these features. Make sure you install at least version 2.0.0.

So first of all make sure you have installed git on your machine(GIT FOR macOS).

Then

  • Open the command palette in vscode(In mac,Press ‘’Cmd + Shift + P’’):
  • Type "open settings"
  • choose "Open Settings (JSON)

In the setting.json file, add the following flag for auto-refreshing: "git.autorefresh": true,

Then save the changes. your problem should be solved.

In addition, There are more git config that you can use them(just type git in setting.json file for more options)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MHM