Test whether a path is ignored by .gitignore

Explain whether a repository path is ignored and which Git pattern matches it.

freeworks offlinenothing uploaded
ToolGit Ignore Checker
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Patterns are matched against repository-relative paths with slash, wildcard, directory-only, negation, and precedence rules. The report identifies the matching pattern rather than only returning yes or no.

  • Git combines the nearest .gitignore with excludes and info/exclude.
  • Repository-relative matching is the useful default.

Worked example

Check source file against common rules
Verify that src/index.ts is not ignored by standard .gitignore patterns (change the File path option to test other files)
Input
											node_modules/
.env
.env.local
dist/
*.log
										
Output
												File: src/index.ts
Status: NOT IGNORED

No matching patterns found.
											

When to use this

Repositories, monorepos, and CI checks explain why generated paths stay untracked.

Edge cases

  • A leading slash anchors a pattern to its .gitignore directory.
  • Negation cannot re-include a file under an excluded parent directory.
  • A trailing slash matches directories, not same-named files.

References