Developer

Runs in your browser. No file uploads for processing.

Test .gitignore Rules and Find the Matching Line

Test paths against a root .gitignore and see the winning line or excluded parent without uploading paths or opening a repository.

Loading tool...

How to see why Git ignores a path

  1. Paste one root .gitignore

    Use the rules in their original order. For example, paste build/ followed by !build/keep.txt.

  2. Enter paths relative to the root

    Enter build/keep.txt as a file and build/ with a trailing slash as a directory. Check which line wins or which parent blocks the path.

  3. Diagnose the exception

    For this example, try /build/* followed by !/build/keep.txt. That excludes the folder’s contents instead of excluding the folder itself, so the exception can act.

Use cases

  • Explain an ignored file or find why an exception cannot reopen a directory.
  • Review a proposed root ignore file against multiple paths and share a local CSV of decisions.

Limits and privacy

  • Simulates one root .gitignore under case-sensitive Git semantics. It has no repository, index, tracked-file status, nested files, sparse checkout or global excludes. A trailing slash in the input is a directory type marker; a shell check against an existing directory can use its name without that slash.
  • Supports common wildcards and standard character classes. Unsupported or malformed rules are reported separately. Up to 100 rules, 75 paths and 12 KiB of input in each box.

The tool processes inputs in your browser. Account features and usage analytics are separate.

Frequently asked questions

What if I want to compare two versions of my rule file?

Use Text Diff Checker to see which lines changed. Use this tool to check how rules affect specific paths after that comparison.

Why is a path ignored despite a later ! exception?

If a rule ignores any parent directory, a child exception does not reopen that parent. Exclude contents with a wildcard or explicitly reopen the parent first.

What does Negated mean?

A ! rule was the last applicable match at that path. Within this simulation, the path is not ignored. This does not tell you whether it is already tracked.

How can I confirm this in my actual repository?

Run git check-ignore -v -- path/to/file in the repository. For an already tracked file, pass --no-index if you want to check what the ignore rules alone would say.

Related tools