Free .gitignore Generator

Create a .gitignore file online. Pick languages, frameworks, IDEs and operating systems from 50 templates, merge them with duplicates removed and download it.

  • No upload, 100% private
  • Instant, in your browser
  • 100% free, no signup
Loading tool…
Read the complete guideHow to Write a .gitignore File: Patterns, Negation and Fixes →

About the .gitignore Generator tool

Every repository needs a .gitignore so that dependencies, build output, editor settings and secret .env files stay out of version control. Remembering the right patterns for each language, framework and operating system is hard, and copying several templates together leaves duplicates. This .gitignore generator builds a single, clean file from the pieces you choose.

Pick from 50 templates grouped into languages (Node, Python, Java, Go, Rust, C#, PHP and more), frameworks (Next.js, Django, Rails, Laravel, Flutter, Unity, Terraform…), IDEs and editors (VS Code, JetBrains, Visual Studio, Vim, Emacs), operating systems (macOS, Windows, Linux) and tools such as Jupyter and dotenv. The templates are condensed from the widely used github/gitignore collection. When you combine them, rules that already appeared in an earlier section are removed, and you can add your own rules at the end.

Presets set up common stacks in one click. The file is built in your browser and can be copied or downloaded.

How to use .gitignore Generator

  1. Search for a technology or click a preset such as “Next.js app”.
  2. Click template chips to add or remove them; selected chips are highlighted.
  3. Add project-specific patterns under “Your own rules (optional)”.
  4. Leave “Remove rules repeated across templates” on to deduplicate.
  5. Copy or download the file and save it as .gitignore in your repository root.

Features

50 templates

Languages, frameworks, editors, operating systems and common tools.

Merged and deduplicated

Repeated rules are dropped and the number removed is shown.

Stack presets

One-click selections for Next.js, Django, Java, Flutter and Go projects.

Clearly sectioned output

Each template gets a ### heading so the file is easy to edit later.

Custom rules

Append your own patterns, including ! negations.

When to use it

  • Start a new repository with the right ignores from the first commit.
  • Stop node_modules or __pycache__ from showing up in git status.
  • Keep .env files with API keys out of a public GitHub repository.
  • Ignore editor and OS clutter such as .idea, .vscode and .DS_Store for a mixed team.
  • Combine rules for a monorepo that has both frontend and backend code.

Frequently asked questions

Where do I put the .gitignore file?

In the root folder of your repository. You can also add more .gitignore files in subfolders; their rules apply relative to that folder.

Why are files still tracked after I ignore them?

.gitignore only affects untracked files. Remove already-committed files from the index with git rm --cached <file>, then commit.

Should I ignore package-lock.json or Cargo.lock?

Usually no for applications, because lock files make builds reproducible. The templates keep them tracked.

My browser saved the file without the dot. What now?

Some systems hide or strip leading dots in downloads. Rename the file to .gitignore, or copy the text into a new file.

Are editor folders like .idea safe to ignore?

Yes for personal settings. Some teams commit shared settings such as .vscode/settings.json, which the VS Code template keeps with ! rules.

Related tools