All tools

.gitignore Pattern Tester

Code

Paste a .gitignore file and a list of file paths, and see which paths would be ignored, matching gitignore glob semantics including negation patterns (!) and directory-only rules.

Paste your .gitignore contents and a list of candidate paths, and it tells you which ones git would actually ignore, following the real matching rules instead of a rough approximation. A leading ! negates a pattern, a trailing / restricts a match to directories, a pattern with a / in the middle is anchored to the .gitignore's own directory, and a pattern with no interior / can match at any depth. When multiple patterns match the same path, the last one in the file wins, which is exactly the part people get wrong when hand-tracing a long .gitignore. One real git behavior it doesn't replicate: git also refuses to re-include a file whose parent directory was already excluded by an earlier pattern unless that directory itself has a matching negation, and this tester evaluates each path independently of that ordering rule.

gitignoregitglobpatternmatching

How to use .gitignore Pattern Tester

  • 1.Paste the contents of a .gitignore file into the first box.
  • 2.List the paths you want to test, one per line, in the second box (add a trailing / to mark a path as a directory).
  • 3.Check the results table for which paths are ignored versus included, and which specific pattern and line number decided each outcome.

Frequently asked questions

Does this read my actual filesystem or git repo?
No, it only evaluates the .gitignore text and paths you paste in your browser. It doesn't scan a real directory or run git itself.
How does negation with ! work?
A pattern starting with ! re-includes a path that an earlier pattern excluded. The last matching pattern in the file order wins, so a negation only works if it comes after the pattern it's meant to override.
Why didn't a negation re-include a file inside an ignored folder?
That's a real git quirk this tool doesn't replicate: git won't descend into an already-excluded directory to check per-file negations unless the directory itself is un-ignored first. This tester checks each path independently, so it may show a result that differs from real git in that specific edge case.
What does a trailing slash on a path mean?
It marks that path as a directory for matching purposes, which matters for gitignore patterns written with a trailing slash that only match directories, not files of the same name.

Use via API, SDK, or MCP

cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/gitignore-tester \
  -H "Authorization: Bearer utx_live_..." \
  -H "Content-Type: application/json" \
  -d '{"gitignore":"node_modules/\n*.log\n!important.log","paths":["node_modules/foo.js","src/index.js","debug.log"]}'

Get an API key from your dashboard · Full API docs →