How to use this tool
- Select the languages, build systems and editors you use.
- Add custom rules in the order Git should evaluate them.
- Download .gitignore into your repository root and check it with git check-ignore -v.
Keep one log file while ignoring the rest
Combine Node patterns with an ordered exception before adding generated fixtures or local environment files to a repository.
Input
Template: Node Custom patterns: *.log !keep.log
Expected output
# Generated locally. Review ordering and negation before use. # Node node_modules/ npm-debug.log* .env* !.env.example # Custom (order preserved) *.log !keep.log
The later !keep.log rule re-includes that name when its parent directory is traversable. Ignoring a path does not untrack a committed file or remove a secret from history; use Git’s index and credential-rotation procedures when appropriate.
More examples
- node_modules/ ignores dependency directories.
- !.env.example re-includes the sample after .env* excludes environment files.
- Custom foo, !foo, foo rules are preserved because order changes their meaning.
Know the limits
Ignore rules do not remove files already tracked by Git or erase leaked secrets from history. Review negations and parent-directory behavior.
Common questions
Are the templates downloaded at runtime?
No. Independently authored CC0 patterns are bundled locally, revision 2026-10-26.
Why keep repeated custom rules?
Later rules can override earlier negations. Deduplicating custom rules globally would change their meaning.