In VSCODE search in the settings the word prune. then enable the checkbox "Prune when fetching" for Git extension.