Whenever I open a Git project that contains submodules, VSCode additionally opens all submodules in the source control view. This clutters the source control view, especially for projects with 10+ submodules.
How do I make VSCode only open the current "root" Git project?
Here, for example, accel...
is the "root" project and unive...
and matpl...
are submodules.
I can go through all the submodules and close them manually, but this is pretty tedious.
Thanks
2
Answers
I followed the answer given in here
https://github.com/microsoft/vscode/issues/53668#issuecomment-403398048
and it worked for me.
Basically go to your VS Code settings (with
Ctrl+Shift+P
and typesettings
then click onPreferences: Open Settings (UI)
) then search forGit: Auto Repository Detection
and change it toopenEditors
.When closing and reopening VS Code, submodules should not appear on the
Source Control
board.@ngazagna’s solution didn’t work for me. What worked was to disable
git.detectSubmodules
, like this: