.gitignore tester
Paste your .gitignore and a list of paths. See which paths git would ignore and which rule decides it. Runs entirely in your browser: nothing is uploaded.
How it decides
- The last matching line wins, so a later
!patternre-includes a path. - A pattern with no slash (
.env) matches at any depth. A pattern with a slash (/build,logs/*) is relative to the .gitignore's folder. - A trailing slash (
node_modules/) only matches folders. - If a parent folder is ignored, nothing inside it can be re-included.
It says "ignored" but git still shows the file?
.gitignore never applies to files git already tracks. Untrack it with git rm --cached <file>, then commit. Full walkthrough: .gitignore not working. To ask git directly which rule matches: git check-ignore -v <path>.
Covers the common rules (*, ?, **, [abc], !, leading and trailing /). It reads one .gitignore at the repo root; nested .gitignore files and global excludes are not modelled.
Catch it at git add
A wrong .gitignore is how a .env slips into a commit. KatchPath warns when a .env, key file or node_modules is about to be staged, whatever your .gitignore says. Free, runs locally:
curl -fsSL https://katchpath.com/install.sh | sh
katchpath install