elefcode

.gitignore Generator

Pick your stacks and build a ready-to-use .gitignore file.

Languages

Frameworks

Operating systems

Editors & tools

# .gitignore generated by elefcode
# Stacks: Node, macOS

# Node
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.pnp.*
.npm
dist/
build/
coverage/

# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
.Spotlight-V100
.Trashes

Advertisement

Guide

About the .gitignore Generator

A .gitignore file tells Git which files and folders to leave out of version control — build output, dependencies, editor settings, OS junk, and secrets. Getting it right from the start keeps your repository clean and, crucially, stops you from accidentally committing things like node_modules or a .env file full of credentials.

This generator lets you pick the languages, frameworks, editors, and operating systems your project uses, then combines the matching ignore rules into one ready-to-use file you can copy or download. Everything runs in your browser.

What belongs in a .gitignore

  • Dependenciesnode_modules, vendor, virtual environments.
  • Build outputdist, build, target, .next.
  • Secrets.env files, keys, and certificates.
  • OS and editor files.DS_Store, Thumbs.db, .idea, .vscode.

Already committed a file you meant to ignore?

Adding a path to .gitignore only affects untrackedfiles — Git keeps ignoring rules from applying to files it's already tracking. If you committed something by mistake, run git rm --cached <file> to stop tracking it, then commit. For secrets that were pushed, rotate them, since they remain in the repository history.

How to use it

  1. 1Select the languages, frameworks, editors, and OSes your project uses.
  2. 2The combined .gitignore builds instantly below.
  3. 3Copy it or download the .gitignore file.
  4. 4Place it in the root of your repository.

Frequently asked questions

Where do I put the .gitignore file?

In the root of your repository. You can also add additional .gitignore files in subfolders to apply rules to specific directories.

Why is my ignored file still tracked by Git?

Because .gitignore only affects untracked files. If a file was already committed, run git rm --cached on it and commit the change to stop tracking it.

Should I ignore my .env file?

Yes. Environment files usually contain secrets and should never be committed. Ignore .env and commit a .env.example with placeholder values instead.

Can I combine multiple stacks?

Yes. Select as many languages, frameworks, editors, and operating systems as you need, and their rules are merged into one file.

Is the file generated locally?

Yes. The .gitignore is built entirely in your browser from bundled templates.

Related tools