Diagnose a matching rule
In your repository, run git check-ignore -v -- path/to/file to see which rule ignored an untracked path and which file contains the rule.
Preparing your comprehensive developer toolkit
Practical Guide
Combine your existing .gitignore with project templates and custom rules. Preview the exact rule order, then copy or download the file.
A .gitignore file tells Git which untracked paths to ignore. Common examples include dependencies, generated output, local settings and editor files.
In your repository, run git check-ignore -v -- path/to/file to see which rule ignored an untracked path and which file contains the rule.
Paste rules and comments to keep them at the top. Selected templates follow, and custom rules appear at the end so you can review precedence before exporting.
Add framework rules to a project with an existing file and review the complete output before replacing the repository copy.
Ignore rules apply to untracked files. A file already in the index stays tracked. Check its status and decide separately whether to remove it from the index.
For rules at the same precedence, the last matching pattern decides. A pattern starting with ! makes an exception, provided Git can still traverse its parent directory.
Official Git documentation on rule syntax, precedence and exceptions.
Shows which Git ignore pattern matched a path.
Open the tool to try these features.