skip to Main Content

Some of the folders in my VSCode workspace contain a large number of git repositories. Whenever I open VSCode, it spends a lot of time opening all these repositories. Usually I only need one or two of these repositories. I can close the unneeded repositories, but it takes a lot of time to open and then close them. Can I change the default behavior, such that no git repository is opened at startup?

2

Answers


  1. Setting "git.ignoredRepositories": ["<repo_name>"] in the workspace settings JSON seems to help (the change is applied after restarting VSCode)

    Login or Signup to reply.
  2. I found a good answer here that discusses these entries for settings.json

    "git.autoRepositoryDetection": false
    or
    git.autoRepositoryDetection": "openEditors"

    And after trying that out, I realized in my case I had a repo with submodules, so VSCode was following the information in the git repo. If someone tries the above setting with no luck, in your project root run

    git submodule status
    

    if you get back a list, you can tell VSCode to not open those with

    "git.detectSubmodules": false,
    

    For completeness:
    Presumably you only want the behavior in a specific workspace. To change workspace settings use command

    Preferences: Open Workspace Settings (JSON)
    

    as described here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search