Trewaters Trewaters - 6 months ago 53
Git Question

Exclude folder from git in Visual Studio Code

I am using Visual Studio Code version 0.7.10. I want to use version control. I figured this was a good time to start teaching myself to use git. I have never used it before.

How do I make git ignore my "node_modules" folder? Every item in this folder is listed for possible commits and that is cluttering up my workspace. I don't want to upload all the packages. I figure whoever runs the package.json can do that on their own computer.

Thought: I found under File > Preferences > User Settings that there is a configuration file called "settings.json" that will overwrite the default settings. I see a "Git configuration" in the default settings but I can't find any documentation on my possible options here. I would think I could do a "git.exclude" but where do I begin. This is only a guess at a solution. I am sure the real answer is something completely different.

I am looking for any documentation you could point me to. Thanks!

UPDATE: I made a change to the ".git/info/exclude" file and my Git repository view cleared up instantly. Here is a link that talks about the exclude file and why it worked for my VS Code editor. (


in git you can alyways use .gitignore to make git ignore some files you can find documentation here :