happytails.ai

Git ignore tester

Check which paths a set of .gitignore rules ignores and see the exact rule that decides each one, in the same format as git check-ignore -v.

Up to 100,000 characters and 1,000 rules, and up to 2,000 paths in 200,000 characters, with rules times path segments under 30,000. Matching runs in your browser. Downloads: check-ignore text, JSON report and CSV. Add files from other folders after a line such as ==> src/.gitignore <==. Up to 100,000 characters. Review the settings before running.

Your result

Report a problem or share an idea.

How to use Git ignore tester
  1. Paste your .gitignore rules. Add files from other folders after a line such as ==> src/.gitignore <==.
  2. List the paths to test, one per line, and end folders with a slash. Every line is a path, including names that start with #.
  3. Run the check and read the deciding source, line and pattern for every path.
  4. Download the plain check-ignore output, the JSON report or the CSV table.

Useful next steps

What it does

The tester applies Git's ignore rules to each path you list and reports whether the path is ignored, which file and line decided it, and whether the decision came from an ignored parent folder. Paths with no matching rule show :: like git check-ignore -v -n.

How matching works

Patterns are matched with a line-by-line port of Git's wildmatch, including negation with !, trailing slashes for folders, leading slashes for anchoring, ** across folders, character classes such as [[:digit:]] and backslash escapes. Deeper .gitignore files win over shallower ones, then .git/info/exclude, then core.excludesFile, and within one file the last matching line wins. As in Git, a file inside an ignored folder cannot be re-included by a later negated rule.

Limits

Paths are taken as written, without a leading ./ or spaces at either end of a line; nothing is read from disk, so a path ending in / or containing other listed paths is treated as a folder. The path list has no comments: a line such as #main.c# is tested as a file name, as with git check-ignore --stdin. Global Git configuration such as core.excludesFile is only used when you paste it under a ==> core.excludesFile <== header. Patterns may use at most 4 ** groups.