Exclude folder from git in Visual Studio Code

In git you can always use .gitignore to make git ignore some files. You can find the documentation here : http://git-scm.com/docs/gitignore


You can use this setting:

"git.ignoredRepositories": []

which specifically does what you're asking. This won't pollute your .gitignore file if the only thing you want to do is to exclude a folder from vscode git but not from git itself. For example, this is useful if your home dir is under version control, since thousands of files would have to be ignored otherwise, which is hardly what you want.


You would make a .gitignore file in the base directory of your git repository and add any files or folders that you would like to ignore. In your case your file would contain

/node_modules/

Documentation: http://git-scm.com/docs/gitignore