Web & email / BROWSER-LOCAL

Gitignore Generator

Combine small, curated templates and custom patterns into a reviewable .gitignore file.

WORKSPACERuns in your browser
Curated templates
One rule per line. Use ! for negations. Existing tracked files are unaffected.
Original CC0 patterns · revision 2026-10-26. If your browser renames hidden files, rename the download to .gitignore.

How to use this tool

  1. Select the languages, build systems and editors you use.
  2. Add custom rules in the order Git should evaluate them.
  3. 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.

Download the example .gitignore

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.

Primary references

Read the full field note