Exclude Ignored Files in VS Code | Generated by AI
You can make “Go to File” (Quick Open, Ctrl + P) include files that live in your .gitignore
by tweaking three settings in your settings.json
:
-
Tell search to ignore your
.gitignore
rules"search.useIgnoreFiles": false, // don’t respect .gitignore "search.useGlobalIgnoreFiles": false // don’t respect your global gitignore
-
Ensure your exclusion globs don’t hide those files By default VS Code inherits all the patterns from
files.exclude
intosearch.exclude
. If you’ve manually excluded.gitignore
-dirs there, re-enable them:"search.exclude": { "**/.git": false, // do index .git (if you want) "**/.gitignore": false // definitely don’t hide your .gitignore file itself // …any other patterns you’d like to override }
-
Reload the window After saving your user or workspace settings, run Developer: Reload Window (⇧ ⌘ P → “Reload Window”) so the file-indexer picks up the change.
Now when you hit Ctrl + P you’ll see all files by name—ignored or not. (stackoverflow.com)