.gitignore / Glob Pattern Tester
Last updated:
Paste .gitignore patterns and a list of sample paths — see which ones are ignored, by which rule, and why. Reproduces real git semantics, including the classic "can't re-include a file inside an excluded directory" trap. All in your browser, nothing uploaded.
How it works
- Unlike every other tool on this page, this one isn’t a Format/Minify/To-JSON triad — it’s an interactive checker, the same shape as this site’s Regex Tester: a list of patterns against a list of sample paths, showing what matches and why.
- A pattern with a
/anywhere except a single trailing slash is anchored to the root (only matches at that exact path); a pattern with no other/can match at any depth — that’s git’s actual rule, not a simplification. A trailing/means “directories only.” **means “any number of directories,” but only when it’s bounded by/on both sides, at the very start, or at the very end — elsewhere it’s treated leniently as a single*rather than rejected.- Mark a sample path as a directory by giving it a trailing
/(e.g.build/) — there’s no real filesystem here to check against, so that’s the only signal this tool has for whether adirOnlypattern should apply to it.
The classic gotcha this tool reproduces on purpose: once a parent directory is excluded, git never walks into it to check per-file patterns — so a later !important-file.txt rule aimed at a file inside an already-excluded directory is silently powerless. A result flagged “a parent directory is excluded” means exactly that: the file’s own patterns were never even consulted. The fix is to un-exclude the directory itself first.
No fabricated syntax errors — git itself never rejects a .gitignore line, however unusual, it just interprets it. This tool does the same: it shows you what each pattern actually matches rather than inventing a validator that’s stricter than real git.
Runs entirely in your browser — nothing you paste here is uploaded, logged, or stored.