What is a .gitignore file?
A .gitignore file lists files and folders that git should not track: installed dependencies, build output, logs, editor settings, operating system clutter and secrets. Without one, repositories fill with noise and, worse, API keys and passwords get committed and leaked.
Tap the templates that match your project, from languages and frameworks to operating systems, editors and tools such as Docker and Terraform. Add your own rules, and the generator produces one combined file with duplicates removed, ready to copy or download.
How to use the .gitignore generator
1.Pick your stack
Languages, frameworks, operating systems, editors and tools.
2.Add your own rules
Project-specific folders or files.
3.Save it
Copy or download, then save as .gitignore in the repository root.
Example: a Next.js project
Node.js, Next.js, macOS, Windows, VS Code and Secrets selected:
- Rules
- 39
- Duplicates merged
- 1 (*.tsbuildinfo appears in both Node and Next.js)
- Kept on purpose
- !.env.example and shared VS Code settings
node_modules, .next, .DS_Store and .env stay out of the repository from the first commit.
One file, no repeats
Templates are merged in a sensible order, each under its own comment, and rules already added by an earlier template aren't repeated. The Secrets template ignores .env files while keeping .env.example, so new contributors still see which variables to set.
Remember that .gitignore only affects untracked files. If something was committed before you ignored it, stop tracking it with git rm --cached <file> and commit, or it will keep showing up.
Frequently asked questions
Should I commit the .gitignore?
Yes. It belongs in the repository so everyone ignores the same files.
What does ! at the start of a rule do?
It re-includes something an earlier rule ignored, like !.env.example.
Why save it as gitignore.txt?
Some systems hide files starting with a dot. Rename it to .gitignore.
Where do OS files like .DS_Store belong?
Ideally in your global gitignore, but adding them here protects everyone.
Related tools
Conventional commit generator
Write commit messages in the Conventional Commits format, with the git command.
Git cheat sheet
Searchable git commands for everyday work, branches, undoing and releases.
Git branch name generator
Turn task titles into clean branch names like fix/login-redirect.
Semver calculator
Bump, compare and check versions against npm-style ranges like ^1.2.0.
JSON Formatter & Validator
Pretty-print, minify, sort and validate JSON with line-numbered errors.
JSON ↔ CSV Converter
Convert JSON arrays to CSV and CSV back to JSON.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table