My tree view hides all of the ignored files that are listed in .gitignore. I cannot find anything in settings.json to show ignored files in my project. How do I show files ignored because of .gitignore?
-
The default seems to have changed over the years, so I actually came here to see how to hide them, and found the answer below :)mhvelplund– mhvelplund2023-12-19 07:02:49 +00:00Commented Dec 19, 2023 at 7:02
-
opposite question is here. intentionally not closing as duplicate right now because it's not clear to me whether/how exclude and ignore settings can override one another.starball– starball ♦2024-03-26 05:19:39 +00:00Commented Mar 26, 2024 at 5:19
8 Answers
The defaults of VS Code puzzle me, but fortunately there is a way to override them. I spent hours searching for a way to expose these files in the Explorer view, and only found it through experimenting based on what I already had for the search:
"search.useIgnoreFiles": false,
"files.useIgnoreFiles": false,
Update: see comments below for updates
3 Comments
files.useIgnoreFiles does not seem to exist (anymore?). all settingsfiles.exclude configuration to tell VSCode what to exclude from the file explorer. It does not use the gitignore file for determining what is visible in the explorer..gitignore by setting "explorer.excludeGitIgnore": false (aka uncheck "Explorer: Exclude Git Ignore").go to Preferences > Settings, uncheck the option search:Use Ignore Files, then it works
1 Comment
This is not currently possible in VS Code but there is discussion in this github issue about making it possible.
I suggest that you give a thumbs up reaction to the issue (click on the thumbs up in the bottom left of the initial post) to voice your support and follow the issue so you can find out if something changes.
2 Comments
First click on the Settings (geartooth) at the bottom of the left margin.
Then search for gitignore.
Un-check the "Explorer: Exclude Git Ignore" box
2 Comments
this is possible - go to Preferences > Settings, and edit the User Settings file to comment out excluded files in the "files.exclude" section - like node_modules etc. Here are my settings for example:
"files.exclude": {
"**/.git": true, // this is a default value
"**/.DS_Store": true, // this is a default value
// "**/node_modules": true,
"**/jspm_packages": true,
"**/coverage": true,
"**/public": true,
"**/.cache": true,
"**/.bundles": true,
"**/es": true,
// "**/dist": true,
// "**/lib": true,
"**/umd": true
},
1 Comment
One interesting work around I found is that in VsCode's file browser, if you right click and create the file or directory you need (ex: right click -> create file -> .gitignore), it will show up. Not the best solution especially if things are nested but gives a quick and dirty way to do it. Also added this answer to the Github issue.
1 Comment
.gitignore itself, but the OP is trying to display the files that are listed inside .gitignore