Support

Test a pattern

Runs in your browser· patterns and paths are matched in this tab and never uploaded

Test glob patterns and .gitignore rules

See what a glob like src/**/*.{ts,tsx} actually matches before you put it in a build config, or check why a file is or is not ignored by your .gitignore. Paste a list of paths, enter the pattern or the rules, and each path is marked with the line that decided it. Matching runs in your browser, with no upload.

Frequently Asked Questions

How do I test a glob pattern against my files?
Paste your file paths (one per line) and type the pattern. Every path is marked as matching or not, with a count. * and ? match within one folder, ** matches across folders, [abc] is a character class, and {a,b} gives alternatives. Turn on "Ignore case" if the match should not depend on capitals.
How does .gitignore decide what is ignored?
Rules are read top to bottom and the last rule that matches a path wins, so a later !pattern can bring a file back. A pattern with no slash matches at any depth, a leading slash anchors it to the root, and a trailing slash matches directories only. The table shows which line decided each path.
Why is my file still ignored after I added a ! rule?
Git cannot re-include a file when one of its parent directories is excluded. With "build/" ignored, "!build/out.js" has no effect, because git never looks inside build. Ignore the contents instead (build/*) and then re-include the file. The page says when a parent directory is the reason.
Is it exactly how git behaves?
It follows the gitignore documentation for the cases above, but it does not read nested .gitignore files, .git/info/exclude or your global ignore file, and it does not know which paths are directories unless you end them with a slash. Use git check-ignore -v in a real repository to confirm anything important.

Found this useful? Hexabench is free and ad-free. If it saved you time, you can support it.

Buy me a coffee →