Gitignore Analyzer

Validate, parse, and test path exclusions against your .gitignore configuration rules in real-time.

Line Pattern Type / Status
Awaiting .gitignore content...

Gitignore Pattern Rules Reference

1. Comments & Blank Lines

Lines starting with # are treated as comments. Blank lines are ignored entirely.

2. Negation Patterns

Prefixing a pattern with an exclamation mark (!) re-includes patterns previously ignored.

3. Directory Indicators

A trailing slash (/) specifies that the pattern matches a directory rather than a plain file.

Troubleshooting rules that do not behave as expected

A path can appear in a .gitignore file and still show up in Git for two different reasons: the pattern may not match its location, or Git may already be tracking the file. Ignore rules prevent untracked files from being added; they do not remove files from the index. If a tracked build artifact should no longer be committed, review the change with your team and use git rm --cached path/to/file to untrack it without deleting the local copy.

Check the rule Git actually matched

When the preview and repository disagree, run git check-ignore -v -- path/to/file from the repository. Git prints the source file, line number, and pattern responsible for the match. This is especially helpful when a nested .gitignore, a global ignore file, or a later rule changes the result. If the command reports nothing, check the path spelling and whether the file is already tracked with git ls-files -- path/to/file.

Use negation with its parent directory in mind

For example, *.log ignores matching log files, while !important.log attempts to keep one exception. Git cannot re-include a file when a parent directory remains excluded, so the directory may need to be made visible first. Pattern behavior also depends on slashes and on which directory contains the ignore file. This page provides a quick preview with a simplified matcher; confirm tricky patterns, nested rules, and production repository behavior with Git itself before relying on the result.

What is Gitignore Analyzer?

Gitignore Analyzer displays each non-comment rule and previews whether a sample file path matches the rules you entered. Use it to spot broad patterns such as *.log, directory rules such as dist/, and negation rules beginning with !. For exact Git behavior—especially nested ignore files and already tracked files—confirm the path with git check-ignore -v in the repository.

How to use this tool

Paste the relevant .gitignore lines, then enter a repository-relative path such as node_modules/react/index.js. Read the matched rule in the result and compare it with the parsed-rule table. If Git still tracks the file, test it with Git’s command-line check: ignore patterns alone do not untrack files already in the index.

Gitignore Analyzer features

Frequently Asked Questions (FAQ)

Yes. This tool is designed to process the values you enter in your browser.