Skip to content
100% local

.gitignore rule tester

Check which of your .gitignore rules ignores or allows each path, and why.

Input
Paths to test
Output

.gitignore rule tester

Paste a .gitignore file into the first field and a list of file or folder paths into the second, and this tool tells you what happens to each one: ignored or not, and which line of the rule set decided it. It's built for the moment a file you expected to be tracked shows up in git status anyway, or a build artifact you thought was excluded gets committed by accident.

The matching follows real .gitignore semantics: patterns are evaluated in order and the last matching rule wins, so a broad "*.log" earlier in the file can be overridden by a narrower "!important.log" later on. A trailing slash marks a rule as directory-only, and ignoring a directory also ignores everything inside it — "node_modules/" catches "node_modules/react/index.js" too, not just the folder itself. Both single "*" wildcards and the recursive "**" are supported, in any position.

Turn off case-sensitive matching to check filesystems that fold case, switch the result table for two plain lists of ignored and not-ignored paths, or hide paths that no rule touched to focus on what your rules actually do. The unused-rules warning flags any line that never matched a tested path — often a typo or a pattern left over from a renamed folder. Windows and Unix line endings are handled the same way in both fields, and the tally under the output reports paths tested, paths ignored, and rules left unused.

Everything runs in your browser; neither your .gitignore rules nor your path list are ever uploaded. Copy the report, download it as a .txt file, or send it back into the input to test another batch of paths.

FAQ

Does this read my actual project files?
No. You paste the .gitignore rules and the paths yourself — the tool never touches a real filesystem or repository.
Why is a file inside an ignored folder shown as ignored, even though no rule mentions its name?
A directory rule like "build/" ignores the folder and everything inside it. The report cites the directory rule that made the call, not the missing file-specific one.
Can I re-include a file with "!" after excluding its parent folder?
This tool applies negation rules in order like git does, but real git has an extra restriction: it will not re-include a file whose parent directory is already excluded. Keep that in mind for negation patterns nested inside ignored folders.
What does "rules that never match" mean?
It lists every rule in your .gitignore that did not match any of the paths you tested — a useful way to spot a typo or a pattern that no longer applies to your project.
Is my .gitignore file or my path list uploaded anywhere?
No. Matching runs entirely in your browser — nothing you paste here ever leaves your device.