You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
explorer.excludeGitIgnore fails to show unignored files and directories #156077
Perhaps the problem is that it tries to replicate git ignore rules and falls short of it, instead of querying git for the ignore status of files.
Yes we try to emulate it because we do not have access to the git executable in core. This has some good benefits too such as not needing git installed for this to work and working in web. I'm surprised b shows up here because we don't support exclude patterns
Sorry, I'm not quite following you here. What do you mean with exclude patterns? !-prefixed one? Those would be re-include, or un-exclude, or better un-ignore patterns. If you mean that you don't support them at all then, yes, it's indeed surprising that b shows up here. Perhaps there is some partial support in place?
? Those would be re-include, or un-exclude, or better un-ignore patterns.
Yeah these. There's definitely many improvements to be made with this parser. I think many of the issues listed all stem from our parsing being slightly different than gits
Logan Ramos (@lramos15) I'm still surprised about this statement. I've also reported #156076 some days ago. Now, take as an example this .gitignore:
*
in a repo where file a.txt has been added. VSCode is oblivious to this fact, it acts as if a.txt were ignored despite it being in the repo. Now if I change .gitignore to:
*
!a.txt
the behavior of VSCode changes to unignore a.txt. #156076 is about the first behavior (ignoring a.txt), which is wrong. But that explicitly unignoring a.txt works around the issue seems to imply that VSCode does support !-patterns, at least to some extent.
the behavior of VSCode changes to unignore a.txt. #156076 is about the first behavior (ignoring a.txt), which is wrong. But that explicitly unignoring a.txt works around the issue seems to imply that VSCode does support !-patterns, at least to some extent.
Yeah technically we do try to support the most basic cases but complex cases break down more.
Git is completely separate but search excludes and files.exclude to hide items in the explorer should operate the same. Its explorer.excludeGitIgnore which does some more massaging of the globs to attempt to match gits behaviors.
If you're interested here's the code pointer for our parsing
I bumped into this again and rereading our old conversation I realize I wasn't explicit enough about differences between file explorer and search/quick open regarding unignored directories and files inside them. Take for example:
Showing an excerpt from a real-world case where a simple exclude rule in a nested .gitignore file causes files to disappear from the Explorer, that are included by git (and understood by tree to be included). b.csv and c.csv are considered by git, but not shown in the Explorer.
The above case breaks even without the nested .gitignore file. Putting this in the root .gitignore isn't honored, either:
Activity
memeplex commentedon Jul 24, 2022
The documentation of excludeGitIgnore says:
Perhaps the problem is that it tries to replicate git ignore rules and falls short of it, instead of querying git for the ignore status of files.
lramos15 commentedon Jul 25, 2022
Yes we try to emulate it because we do not have access to the git executable in core. This has some good benefits too such as not needing git installed for this to work and working in web. I'm surprised b shows up here because we don't support exclude patterns
memeplex commentedon Jul 25, 2022
Sorry, I'm not quite following you here. What do you mean with exclude patterns? !-prefixed one? Those would be re-include, or un-exclude, or better un-ignore patterns. If you mean that you don't support them at all then, yes, it's indeed surprising that b shows up here. Perhaps there is some partial support in place?
lramos15 commentedon Jul 25, 2022
Yeah these. There's definitely many improvements to be made with this parser. I think many of the issues listed all stem from our parsing being slightly different than gits
memeplex commentedon Aug 18, 2022
Logan Ramos (@lramos15) I'm still surprised about this statement. I've also reported #156076 some days ago. Now, take as an example this .gitignore:
in a repo where file a.txt has been added. VSCode is oblivious to this fact, it acts as if a.txt were ignored despite it being in the repo. Now if I change .gitignore to:
the behavior of VSCode changes to unignore a.txt. #156076 is about the first behavior (ignoring a.txt), which is wrong. But that explicitly unignoring a.txt works around the issue seems to imply that VSCode does support !-patterns, at least to some extent.
memeplex commentedon Aug 18, 2022
So perhaps the situation is far from tidy, where
have all different ideas of what's ignored and what's not?
lramos15 commentedon Aug 19, 2022
Yeah technically we do try to support the most basic cases but complex cases break down more.
Git is completely separate but search excludes and
files.excludeto hide items in the explorer should operate the same. Itsexplorer.excludeGitIgnorewhich does some more massaging of the globs to attempt to match gits behaviors.If you're interested here's the code pointer for our parsing
vscode/src/vs/workbench/services/search/common/ignoreFile.ts
Line 9 in 78cd55a
memeplex commentedon Aug 24, 2023
I bumped into this again and rereading our old conversation I realize I wasn't explicit enough about differences between file explorer and search/quick open regarding unignored directories and files inside them. Take for example:
Here both file explorer and search/quick open recognize
.bashrc, but only search/quick open recognizes.config/radian/profile.mietzen commentedon Jan 21, 2024
Logan Ramos (@lramos15) any update on this? Might this: https://github.com/fabiospampinato/fast-ignore help?
Phrogz commentedon Sep 9, 2025
Showing an excerpt from a real-world case where a simple exclude rule in a nested
.gitignorefile causes files to disappear from the Explorer, that are included by git (and understood bytreeto be included).b.csvandc.csvare considered by git, but not shown in the Explorer.The above case breaks even without the nested
.gitignorefile. Putting this in the root.gitignoreisn't honored, either:Fix gitignore negation patterns not overriding parent/global rules
Fix gitignore negation patterns not overriding parent/global rules
Fix gitignore negation in child files not overriding parent/global ru…
bryanchen-d commentedon May 12, 2026
I can still repro the issue, only 'b' shows up in the explorer, we should see d, d/a.
dmitrivMS commentedon May 12, 2026
Bryan Chen (@bryanchen-d) Thanks, yes, that's correct - the PR fixed part of this, but not all.