Account

What new tool do you want?

Developer Tools

.gitignore Generator

Build a .gitignore file for your stack — Node, Python, Java, Go, Rust, .NET, Flutter plus OS and editor files — in a few clicks.

How to use

  1. 1Tick the languages, tools and operating systems you use.
  2. 2Copy the result into a file named .gitignore in your repository root.

Frequently asked questions

Where does the .gitignore file go?

In the root of your repository. You can add more .gitignore files in subfolders for rules that apply only there.

Why is a file still tracked after I ignored it?

.gitignore only affects untracked files. Run git rm --cached <file> to stop tracking it, then commit.

Should .env files be ignored?

Yes — they usually hold secrets. Commit a .env.example with placeholder values instead, which the template allows with !.env.example.

A worked example of the exception syntax

The default templates tick Node, Secrets & env files, macOS, Windows, VS Code and Logs — and the "Secrets & env files" template specifically outputs .env, .env.*, and then !.env.example as a separate line. That leading ! is gitignore's negation syntax: it un-ignores a pattern that an earlier, broader pattern would otherwise have excluded. Without it, a repository convention of committing a safe .env.example with placeholder values alongside a gitignored real .env would break, because .env.* on its own would swallow .env.example too.

Why picking the wrong stack template leaves real files tracked

Ticking Python when your actual stack is Node (or vice versa) doesn't cause errors — it just silently ignores nothing relevant, since the templates are independent and additive; you can tick several truthy templates at once (the defaults already combine six). The more common mistake is adding a .gitignore to a project that already has files like node_modules/ committed from before the file existed — .gitignore only affects files Git doesn't already know about, so previously-tracked files stay tracked until you explicitly run git rm --cached on them.

Why OS and editor templates matter even on a team using one stack

The macOS, Windows, Linux and editor-specific templates (VS Code, JetBrains) exist because these junk files get created by your operating system and editor regardless of what language your project uses — a Mac user on a Node project still generates .DS_Store files in every folder, and a Windows user generates Thumbs.db. Including these templates regardless of your language stack prevents a steady trickle of environment-specific noise files from ever showing up in `git status` or getting accidentally committed by a teammate on a different OS.

Why a per-repo .gitignore isn't the only option

Everything this generator outputs is meant to be committed to the repository so every contributor gets the same rules — but Git also supports a global, user-level ignore file (set with git config --global core.excludesfile ~/.gitignore_global) for things that are personal to your machine rather than the project, like a specific editor's swap files or an OS quirk nobody else on the team has. Mixing the two matters: put project-relevant ignores (build output, dependency folders, secrets) in the committed .gitignore this tool generates, and keep purely personal tooling preferences in your own global file so you're not forcing your editor's config choices onto every other contributor's commit history. Teams that skip this distinction often end up with a bloated, debated .gitignore where half the entries only matter to whoever happened to write them, instead of one that reflects the project's actual stack.

Related tools

More: Developer Tools