Gitignore path inspector
Test supplied paths under one root Gitignore file and trace the final matching rule and excluded parent directory.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Explain an unexpected ignore decision before changing your rules. Supply the exact path spelling, mark directories with a trailing slash, and inspect which rule wins.
How to use this tool
- Paste or open one root .gitignore and enter one path per line. Keep path case and meaningful spaces.
- Use a trailing slash for directories, then inspect status, rule line and any blocking parent.
- Download the full report. Check tracked/global/nested rules separately in the actual repository.
Supported inputs and limits
One UTF-8 rules file or pasted rules and a path list, with a combined 1 MiB budget. Up to 5,000 physical rule lines and 10,000 paths, each at most 1,024 UTF-16 units and 32 components. Matching stops at 2,000,000 rule tests. Selected file takes precedence.
Paths are case-sensitive, relative POSIX names under the supplied root rules. A trailing slash declares a directory; an unmarked final component declares a file. No absolute paths, backslashes, empty components, . or .. components, or control characters. No repository, tracked-file, global-ignore or nested-ignore lookup.
Uses the patterns compiled by locked ignore 7.0.5, including escaped #/!, spaces, character classes, ** and negation. The last directly matching rule wins. An excluded parent blocks descendant re-inclusion; its winning rule and path are reported. Empty/comment-only rules are allowed. LF and CRLF are supported; CR-only is rejected.
The table shows the first 200 supplied paths; JSON and CSV include all paths. Formula-like CSV cells receive an apostrophe by default. JSON preserves exact pattern/path strings.
Worked example
Example input
*.log !keep.log build/ !build/keep.txt
Example options
{"secondary": "a.log\nkeep.log\nbuild/keep.txt\nsrc/main.ts", "params": {}}Example output
{
"scope": "one root .gitignore; supplied paths only",
"records": [
{
"path": "a.log",
"directory": false,
"ignored": true,
"status": "ignored",
"line": 1,
"pattern": "*.log",
"blockingPath": null
},
{
"path": "keep.log",
"directory": false,
"ignored": false,
"status": "unignored",
"line": 2,
"pattern": "!keep.log",
"blockingPath": null
},
{
"path": "build/keep.txt",
"directory": false,
"ignored": true,
"status": "ignored",
"line": 3,
"pattern": "build/",
"blockingPath": "build/"
},
{
"path": "src/main.ts",
"directory": false,
"ignored": false,
"status": "unmatched",
"line": null,
"pattern": null,
"blockingPath": null
}
]
}When something does not work
Fix path spelling and mark directory types explicitly. Remove the selected file to switch to pasted rules. Reduce the path/rule count or split a large batch when the matching budget is exceeded.
Frequently asked questions
Does a negation below an excluded directory work?
A descendant cannot be re-included while its parent stays excluded. Re-include the parent directory first.
Does it know which files are already tracked?
No. This tests the supplied root rules only; tracked-file status is outside the input.
What does a blank rule line mean in the result?
No rule directly matched that file/directory and no excluded parent blocked it. A negative match is reported separately as unignored.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.