Back to all tools

.gitignore Generator

Generate .gitignore files for any language or framework. Select from 40+ templates and download instantly.

What is a .gitignore file?

A .gitignore file tells Git which files and directories to ignore in a project. It prevents accidentally committing build artifacts, dependencies, environment variables, editor settings, and other files that don't belong in version control. Each line in the file specifies a pattern — files matching those patterns are excluded from git tracking.

Proper .gitignore setup prevents polluting repositories with files like node_modules/, __pycache__/, .env, and IDE configuration folders.

How to Use This .gitignore Generator

  1. Select templates — Check the languages, frameworks, and tools your project uses.
  2. Search to filter — Use the search box to quickly find templates by name or category.
  3. Preview the output — The generated .gitignore is shown in real time with all sections combined.
  4. Copy or Download — Copy to clipboard or download as .gitignore directly.

Common Use Cases

Frequently Asked Questions

What should I include in a .gitignore for a Node.js project?

At minimum: node_modules/, .env files, build output (dist/, build/), and npm debug logs. Also consider adding your editor's config folder (e.g., .vscode/ or .idea/) and OS files like .DS_Store.

Can I use multiple templates in one .gitignore?

Yes. This generator lets you select as many templates as you need and merges them into a single .gitignore file with clearly labeled sections. Duplicate patterns are automatically removed.

How do I stop tracking a file that's already committed?

Adding a file to .gitignore only prevents future tracking. To untrack a file already in git, run: git rm --cached filename. Then commit the removal. The file will remain on disk but will no longer be tracked.