1. Home
  2. Developer tools
  3. .gitignore Generator

.gitignore Generator

Start a repository with a .gitignore that keeps dependencies, build output, secrets and editor clutter out of Git from the first commit.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use .gitignore Generator

  1. Pick the languages, frameworks, OS and editors in the project.
  2. Add patterns of your own.
  3. Download .gitignore and test paths against it.

Features

  • 26 templates: Node, Python, Java, Go, Rust, .NET, Next.js, Django, Unity, Terraform…
  • Duplicate lines removed across templates
  • Secrets section with !.env.example kept
  • Path tester that shows the rule that matched
  • Sample sets for a Next.js and a Django app

Supported formats

Input

  • Form input

You get

  • GITIGNORE

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the .gitignore Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Templates cover common setups; tools with unusual output folders still need their own lines.

Guide

Writing a .gitignore that keeps the right files out of Git

A .gitignore file tells Git which files to leave untracked: dependencies that can be reinstalled, build output, logs, editor settings and, most importantly, secrets. Starting a repository without one is how node_modules folders and .env files end up in commit history. This generator combines ready templates for the languages, frameworks, systems and editors in your project into one file, and lets you test paths against it.

How patterns work

Each line is a pattern. A plain name such as node_modules/ matches a folder of that name anywhere in the repository; the trailing slash limits it to folders. A pattern with a slash at the start or in the middle, such as /build or docs/*.pdf, is anchored to the folder containing the .gitignore. * matches anything except a slash, **/ matches any number of folders, and a leading ! re-includes something an earlier line ignored. When several lines match, the last one wins.

The templates

Language templates cover dependency folders, caches and compiled files for Node.js, Python, Java, Go, Rust, .NET, PHP, Ruby and Swift. Framework templates add the output of Next.js, Astro and Vite, Django, Laravel, Android, Flutter and Unity. Tool templates handle Terraform state, Docker overrides, logs and secrets. Operating-system templates catch .DS_Store, Thumbs.db and similar files, and editor templates handle VS Code, JetBrains IDEs and Vim swap files.

Merging without duplicates

Many templates share lines; build/ or *.log appear in several. The generator writes each template under a heading in the order you picked them and drops any line that an earlier section already contains, so the result stays short and readable. Patterns you type in the “your own patterns” box are added at the end under a Project heading.

Secrets and lockfiles

The secrets template ignores .env and every .env.* file, then re-includes .env.example with !.env.example, so the template of variable names can be committed while real values cannot. Lockfiles such as package-lock.json, pnpm-lock.yaml and poetry.lock are deliberately not ignored: committing them is what makes installs reproducible. The Flutter template is the exception: it ignores pubspec.lock, which suits packages, but Dart recommends committing the lockfile for apps, so delete that line in an app project.

A worked example

The “Sample: Next.js app” button picks Node.js, Next.js, secrets, logs, macOS, Windows, VS Code and JetBrains. The file starts with # Node.js and node_modules/, includes a # Next.js section with .next/ and next-env.d.ts, contains !.env.example, and lists .DS_Store exactly once even though it could come from several places: 68 lines in all. Testing the path web/.next/cache/x.json reports that it is ignored by the rule .next/.

Testing paths

Type a path in the tester to see whether the current patterns ignore it and which line decides. End a path with a slash to test it as a folder. For the definitive answer in a real repository, git check-ignore -v path prints the file and line of the matching rule.

What a .gitignore cannot do

It only affects untracked files. If a file is already committed, ignoring it changes nothing until you run git rm --cached on it. Git also never looks inside an ignored folder, so a ! rule cannot re-include a file whose parent folder is ignored; ignore folder/* instead of folder/ if you need exceptions inside it.

Checked against the current version of the .gitignore Generator on .

Frequently asked questions

Should .vscode or .idea folders be ignored?

Personal editor state should be, but shared settings can be useful. The VS Code template ignores the folder except settings.json, tasks.json, launch.json and extensions.json, so a team can share recommended extensions and debug setups while keeping personal files out.

Can I have more than one .gitignore?

Yes. Any folder can have its own .gitignore, whose patterns apply relative to that folder. There is also .git/info/exclude for rules you do not want to commit, and a global file set with git config --global core.excludesFile for editor and OS clutter on your own machine.

I added a file to .gitignore but Git still tracks it. Why?

Ignore rules only apply to untracked files. Run git rm --cached on the file (it stays on disk), commit, and from then on the rule applies. If it contained a secret, rotate the secret too.

Should package-lock.json or poetry.lock be ignored?

Not for applications: lockfiles make installs reproducible and should be committed. Some library authors ignore them, but most ecosystems now recommend committing them everywhere.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.