If you need a .gitignore right now, open the Gitignore Generator, select your languages, frameworks, editors and operating systems, press Copy, and save the result in the root of your repository. Nothing is installed and nothing is uploaded: the templates are part of the page and the file is assembled in your browser.

Disclosure: the tool and the guide linked here are part of DevToolEra, a site I run.

This post walks through every control in the tool, what the 27 templates contain, and the checks you should still do by hand. Three takeaways:

  1. Combine one template per language, framework, editor and OS you use. Each stays in its own labelled section.
  2. A generated file is a good start, not a finished one. Secrets, lock files and database files need a human decision.
  3. A .gitignore never un-tracks a file Git already knows about.

What a .gitignore does

A .gitignore is a plain text file that tells Git which files and folders to leave alone: dependency folders such as node_modules/, compiled output, editor settings, operating-system junk like .DS_Store, and above all files with secrets such as .env. Each line is a pattern. Writing them by hand for every new project is slow and easy to get wrong, which is why combining ready-made templates helps.

Step 1: Pick your templates

The page lists 27 templates:

  • Languages: Node, Python, Java, Go, Rust, Ruby, PHP, Swift / Xcode, Kotlin, .NET / C#, C / C++, Dart / Flutter
  • Operating systems: macOS, Windows, Linux
  • Editors: VS Code, JetBrains IDEs, Vim, Sublime Text
  • Tools and infrastructure: Docker, Terraform
  • Frameworks: React, Next.js, Django, Laravel
  • Others: Unity, LaTeX

Click a template to select it, click again to remove it. macOS, Windows and Linux start selected, because their system files (.DS_Store, Thumbs.db) should never be committed. Use the Filter templates box to narrow the list by name.

Step 2: Watch the file build itself

There is no Generate button. The result updates whenever the selection changes, and a status line says how many templates went in. Your choices appear as removable chips under Selected, and Clear selection starts from nothing.

A Node project edited on a Mac gives you:

### Node ### node_modules/ npm-debug.log* dist/ build/ coverage/ .env .env.local ### macOS ### .DS_Store 

You can select as many templates as you like. A full-stack project might combine Node, React, Python, Docker, VS Code and macOS, and every template keeps its own section, so the file stays readable.

Step 3: Copy or download

Use Copy for the clipboard, or Download to save a file already named .gitignore. Put it in the repository root and commit it:

git add .gitignore git commit -m "Add .gitignore" 

Step 4: Check what a generic file can't know

The tool page itself says the templates cover common cases and are not a byte-for-byte copy of any single source, GitHub's own included. Review the result with these five checks.

1. Secrets. Only the Node, Python, React, Next.js and Laravel templates list .env. If your stack keeps secrets elsewhere, add that file yourself. If a secret was ever committed, rotating it matters more than deleting the file, because it stays in Git history. Keep a .env.example with placeholder values in the repo instead.

2. Lock files. The Rust template ignores Cargo.lock and the Dart template ignores pubspec.lock. That suits libraries; applications usually commit them, so delete those lines for an app. The Dart template also ignores generated *.g.dart files, so remove that line if you commit generated code.

3. Wrapper files. The Java template ignores *.jar but keeps gradle/wrapper/gradle-wrapper.jar and .mvn/wrapper/maven-wrapper.jar, so your build wrappers still work.

4. Database files. The Python and Django templates ignore *.sqlite3. Remove that line if your project ships a database file.

5. Order matters. A line starting with ! re-includes a file only if it comes after the pattern that ignored it. Don't sort or reorder the lines.

One more from my own read of the templates: the Terraform template ignores .terraform.lock.hcl. Many teams commit that file to pin provider versions, so decide for your project and delete the line if you want it tracked.

A closer look: Python and Unity

Python. The template ignores __pycache__/, compiled files (*.py[cod]), virtual environments (.venv/, venv/, env/), test and type-checker caches, build output, .ipynb_checkpoints/ and .env. Add Django for a Django project.

Unity. The template ignores the generated folders Library, Temp, Obj, Build, Builds, Logs, UserSettings, MemoryCaptures and Recordings at the project root, Visual Studio files, and build outputs such as *.apk, *.aab and *.unitypackage. It does not ignore .meta files. Keep them in Git, because they store each asset's identity and links. Commit Assets, Packages and ProjectSettings, and add JetBrains IDEs if you use Rider.

Files Git already tracks

A .gitignore only affects files Git is not tracking yet. If a file was committed earlier, remove it from the index and commit:

git rm --cached path/to/file git commit -m "Stop tracking file" 

To see what the generated file would add to an existing one, paste both versions into the Text Diff Checker. Before committing, you can check text for leaked keys with the Secret Scanner, and if a key has already leaked, read Leaked API Key or Secret? What to Do Right Now.

Four everyday recipes

  1. A new Node and React app on a Mac: select Node, React and VS Code (macOS is already on), copy, save, commit.
  2. A Python or Django backend: select Python and Django, then remove *.sqlite3 if you want to keep a seed database.
  3. A Unity game: select Unity (plus JetBrains IDEs for Rider) and keep your .meta files.
  4. Machine-wide junk: for OS and editor files you never want in any project, set a global ignore file once with git config --global core.excludesfile instead of repeating it everywhere.

Good to know

  • Privacy: the tool runs entirely in your browser; your selection is not sent to a server.
  • Not a mind reader: it doesn't know your custom build folders or local config. Add those lines after copying.

FAQ

How do I create a .gitignore file? Select your languages, frameworks, editors and operating systems, then copy the result or download it as .gitignore and save it in the repository root.

How many templates are there? 27, filterable by name.

Can I edit the result? Yes, copy or download it and add your own lines.

Should I ignore .env? Yes, and keep a .env.example with placeholder values.

Wrap-up

To recap: combine one template per tool you use, review the five checks before you commit, and remember that git rm --cached is what stops tracking an existing file. Try it yourself in the Gitignore Generator, select Node and Python, and read the two labelled sections. For the full reasoning on secrets, lock files and already-tracked files, read the companion guide, Gitignore for .env Files: Keep Secrets Out of Git. More free, private, browser-based utilities are on the DevToolEra home page.