Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. (https://help.github.com/articles/ignoring-files/)

like image 483
Trewaters Avatar asked Aug 18 '15 23:08

Trewaters


People also ask

How do I exclude folders from Git repository?

Open the . git/info/exclude file in a text editor and add the folder to ignore. This file remains private to you.

How do I ignore files in Git push Visual Studio?

Visual Studio Git In the Git Changes window, right-click any changed file that you want Git to ignore and choose Ignore this local item or Ignore this extension.


1 Answers

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

like image 131
Ahmed Eid Avatar answered Sep 19 '22 15:09

Ahmed Eid