skip to Main Content

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.
enter image description here

I can go through all the submodules and close them manually, but this is pretty tedious.

Thanks

2

Answers


  1. 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 type settings then click on Preferences: Open Settings (UI)) then search for Git: Auto Repository Detection and change it to openEditors.

    When closing and reopening VS Code, submodules should not appear on the Source Control board.

    Login or Signup to reply.
  2. @ngazagna’s solution didn’t work for me. What worked was to disable git.detectSubmodules, like this:

    {
      "git.detectSubmodules": false
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search