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?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
Setting
"git.ignoredRepositories": ["<repo_name>"]
in the workspace settings JSON seems to help (the change is applied after restarting VSCode)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
if you get back a list, you can tell VSCode to not open those with
For completeness:
Presumably you only want the behavior in a specific workspace. To change workspace settings use command
as described here