How to Use This Tool
Paste your patterns and your file paths. Both dialects run at once, and any file they disagree about is marked.
The gitignore anchoring rule
This is the one that costs people real incidents, and it is a single sentence:
If a pattern contains a slash anywhere except at the end, it is anchored to the repository root. Otherwise it matches at every depth.
node_modules— no slash, so it matchesnode_modules/,packages/web/node_modules/, everything./node_modules— leading slash, so only the one at the root. In a monorepo the nested ones are committed, and nothing warns you.config/secret.env— contains a slash, so it is anchored. A file atservices/api/config/secret.envis not ignored.
The last case is the dangerous one. The pattern looks specific and reads as though it means “any config/secret.env”. It does not.
The ** rule that is not what people assume
* never crosses a /. ** does — but only when it stands as
a whole path segment.
src/**/*.js—**is its own segment, so this is recursive.src/**.js—**is glued to.js, so it degrades to a single*and matches only files directly insrc/.
That second form appears constantly in build configs written by people expecting recursion. It runs, it matches something, and it quietly skips every nested file.
What the two columns mean
gitignore applies the anchoring rule above, treats a trailing / as
“directory only”, and lets a later ! line re-include something an earlier line
excluded. Order matters: the last pattern that matches wins.
shell glob is the plain form used by most build tools and by
minimatch: every pattern is matched against the whole path, nothing is implicitly
anchored or unanchored, and there is no negation.
When the two columns disagree, it means the same line in your config would do different things in
.gitignore and in your bundler. That is worth knowing before you rely on it.
Limits worth stating
Real .gitignore resolution also depends on files on disk — whether a path is a
directory, and nested .gitignore files in subfolders that apply relative to themselves.
This page only sees the text you paste, so it cannot model either. For the anchoring and **
questions, which is what people actually get wrong, the text is enough.
