.gitignore Generator

Generate .gitignore files for your projects with 50+ pre-built templates. Select from languages, frameworks, OS, IDEs, and build tools. Combine multiple templates with automatic deduplication and add custom rules.

.gitignore Generator

Generate .gitignore files for your projects with pre-built templates

Languages (15)

Frameworks (12)

Build Tools (10)

Operating Systems (3)

IDEs & Editors (4)

Other Tools (8)

Example: *.log, /dist/, !important.txt

Tips & Info

Free .gitignore Generator

A .gitignore file tells Git which files and folders to exclude from version control. Without a proper .gitignore you risk accidentally committing sensitive credentials, node_modules, build artifacts, IDE settings, or OS-specific files like .DS_Store.

This free .gitignore generator offers 50+ pre-built templates for languages, frameworks, build tools, operating systems, and IDEs. Select multiple templates and they merge automatically into one clean file.

Available templates

  • Languages: Node.js, Python, Java, Go, Rust, PHP, Ruby, C++, TypeScript, C#, Swift, Kotlin, Dart, Elixir, Scala.
  • Frameworks: React, Vue, Next.js, Nuxt, Angular, Svelte, Django, Flask, Laravel, Rails, Spring, Astro.
  • IDEs: VSCode, JetBrains (IntelliJ, WebStorm, PyCharm), Sublime Text, Vim.
  • Operating Systems: macOS (.DS_Store), Windows (Thumbs.db, desktop.ini), Linux.
  • Build Tools: npm, Yarn, pnpm, Maven, Gradle, Webpack, Vite, Parcel, Turborepo, CMake.
  • Infrastructure and other tools: Docker, Terraform, Unity, Godot, Jupyter, virtualenv and a Secrets template for keys and .env files.

How to generate a .gitignore file

  1. Search or browse for templates matching your project stack.
  2. Select one or more templates: they combine automatically with deduplication.
  3. Add custom rules in the custom rules section (e.g., .env, *.local).
  4. Preview the final file and click Download .gitignore.
  5. Place the file in your project root and commit it immediately.

What should always be in your .gitignore?

  • .env files: Never commit .env, .env.local, or any file with API keys, database passwords, or secrets.
  • node_modules/: Always ignored for Node.js projects. Reinstall via npm install.
  • Build outputs: dist/, build/, .next/, .nuxt/ are generated files and should not be tracked.
  • OS metadata: .DS_Store (macOS) and Thumbs.db (Windows) are noise in any repository.
  • IDE configs: .idea/, .vscode/ (personal settings), *.suo are machine-specific and not useful to teammates.

Adding a .gitignore at the start of every project is a best practice that prevents security leaks, keeps repositories clean, and avoids merge conflicts caused by machine-specific generated files.

Frequently Asked Questions

Which templates should I combine?

Pick the language, the framework, the package manager, your operating system and your editor, for example Node, Nuxt, pnpm, macOS and VisualStudioCode. The Quick Start presets do this for common stacks, and repeated patterns such as node_modules/ are written only once thanks to automatic deduplication.

Why are files still tracked after I add them to .gitignore?

A .gitignore only affects files that are not yet tracked. To stop tracking a file that was already committed, run git rm --cached path/to/file, commit, and it will be ignored from then on. For a whole folder use git rm -r --cached folder/.

How do gitignore patterns work?

One pattern per line. A trailing slash matches directories only, a leading slash anchors the pattern to the repository root, * matches anything except a slash, ** matches nested directories and a leading ! re-includes a file excluded by an earlier rule, like !.env.example after .env.*. Lines starting with # are comments.

Should I commit lock files and .env files?

Commit package-lock.json, yarn.lock or pnpm-lock.yaml for applications so every install is reproducible, libraries often leave them out. Never commit .env files or any file containing secrets, the Secrets template ignores .env, private keys and credential JSON files while keeping .env.example tracked.

Free forever, no ads, no tracking. Support the project