.gitignore Generator
Select your languages, frameworks, editors and operating systems — get a clean, comprehensive .gitignore file ready to drop into any project.
Language/Runtime
Framework
Editor/IDE
Operating System
Tools
# ────────────────────────────────── # Language/Runtime # ────────────────────────────────── # Node.js node_modules/ npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* .npm .yarn-integrity .pnp.* .node_repl_history *.tgz package-lock.json # ────────────────────────────────── # Framework # ────────────────────────────────── # Next.js # Next.js .next/ out/ build/ # Next.js production .vercel # Turbopack .turbo/ # TypeScript *.tsbuildinfo next-env.d.ts # ────────────────────────────────── # Editor/IDE # ────────────────────────────────── # VS Code .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json !.vscode/*.code-snippets .history/ *.vsix # ────────────────────────────────── # Operating System # ────────────────────────────────── # macOS .DS_Store .AppleDouble .LSOverride Icon ._* .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk # ────────────────────────────────── # Tools # ────────────────────────────────── # Env / Secrets .env .env.* !.env.example *.pem *.key *.p12 *.pfx secrets.json credentials.json service-account*.json
What is a .gitignore file?
A .gitignore file tells Git which files and directories to ignore — never track, stage, or commit. Every project needs one. Without it, your repository fills up with node_modules/, compiled binaries, IDE configuration, OS junk like .DS_Store, and secrets like .env files.
A well-crafted .gitignore keeps your repository lean, prevents accidental secret leaks, eliminates noisy diffs from generated files, and makes cloning fast. It is one of the first files you should create in any new project.
This tool generates a .gitignore by combining templates for your specific stack — select your language, framework, editor, and OS, get a merged .gitignore with section headers so you know where each rule came from.
How to generate your .gitignore
- 1
Select your stack
Check every language, framework, editor, OS and tool used in this project.
- 2
Preview and copy
The generated .gitignore appears instantly. Use Copy or Download to save it.
- 3
Add to project root
Place .gitignore in the root of your repository — same level as package.json or requirements.txt.
Why every project needs a .gitignore from day one
Prevent secret leaks
.env files, API keys and credentials must never reach a remote repo. A .gitignore with .env entries is your first line of defence.
Keep repos small and fast
node_modules alone can be gigabytes. Ignoring build artifacts and dependencies keeps clones fast and storage costs low.
Cleaner diffs and reviews
Generated files and IDE settings create noise in pull requests. Ignoring them means every diff shows only intentional changes.
Avoid OS clutter
.DS_Store (macOS) and Thumbs.db (Windows) are local metadata files that have no place in a shared repository.
.gitignore syntax cheat sheet
node_modules/— trailing slash matches only directories*.log— wildcard matches any file with that extension!important.log— leading ! negates (un-ignores) a pattern/dist— leading slash anchors to the repository root**/coverage— double asterisk matches any depth#— lines starting with # are comments
Already committed a file you want to ignore?
- Adding to .gitignore does NOT remove already-committed files from history.
- Un-track a file:
git rm --cached filename(removes from index, keeps local file). - Un-track a directory:
git rm -r --cached directory/. - Then commit the removal and add the entry to .gitignore.
Frequently asked questions
In the root of your repository. Git also respects .gitignore files in subdirectories — they apply to that directory and its children. For local-only rules (not shared with the team), use .git/info/exclude instead.
Git only ignores untracked files. If a file was already committed, Git continues tracking it even after you add it to .gitignore. Run git rm --cached filename to un-track it, then commit the change.
Yes, always. .gitignore is project configuration that benefits all contributors — it ensures everyone ignores the same files.
Yes. Create ~/.gitignore_global and run: git config --global core.excludesfile ~/.gitignore_global. Put OS-specific patterns there (like .DS_Store) so you don't repeat them in every project.
Need another tool?
Browse the full toolbox or dig into the blog for the engineering behind it.