Developer

Gitignore Generator

Generate merged and deduplicated .gitignore output from stack presets.

Loading interactive tool…

Embed this tool on your site

About this tool

Accidentally committing build artifacts, node_modules or IDE settings is easy to do and tedious to undo once it is in the history. The Gitignore Generator builds a starting .gitignore from nine built-in presets: Node, Python, Java, Go, Rust, .NET, macOS, VSCode and JetBrains. Tick the stacks your project uses, or Select all options, and the tool merges their patterns into one list in preset order, dropping any line that appears in more than one preset — for example build/ shared by Python and Java, or bin/ shared by Go and .NET. Each preset is a short, hand-picked list of common entries rather than a copy of GitHub's full gitignore templates, so review the result and append anything specific to your project. The output updates as you tick boxes, and Copy output puts the file on your clipboard. Everything runs in your browser.

Why use it

  • Merges Several Stacks Into One File: Tick Node, macOS and VSCode together and get a single list instead of concatenating separate snippets by hand.

  • Removes Duplicate Lines: Patterns shared between presets, such as build/ in Python and Java or bin/ in Go and .NET, appear only once in the merged output.

  • Keeps Heavy Folders Out of Git: Presets cover node_modules/, __pycache__/, .venv/, .gradle/, target/, bin/ and obj/, which keeps repositories small and clones fast.

  • Cuts Editor and OS Noise: The macOS, VSCode and JetBrains presets ignore .DS_Store, .idea/ and personal .vscode files while keeping shared settings.json, tasks.json, launch.json and extensions.json tracked.

  • Short, Readable Output: Each preset holds only a handful of common patterns, so the file is easy to review line by line before you commit it.

How to use

  1. Tick each stack your project uses in the preset grid: Node, Python, Java, Go, Rust, .NET, macOS, VSCode or JetBrains.
  2. Use Select all options to tick every preset at once, or untick it to clear them all.
  3. Watch the Generated .gitignore box update as you tick boxes; the Generate button rebuilds it on demand.
  4. Review the merged list, delete lines that do not fit your project and add your own paths at the end.
  5. Click Copy output and paste the text into a .gitignore file in your project root, then commit it.

When it helps

  • When initialising a new project and you need a .gitignore before your first commit
  • When adding a new language or framework to an existing monorepo
  • When onboarding a team member who asked why IDE files keep appearing in pull requests
  • When migrating a project from one stack to another and the old .gitignore no longer fits
  • When you inherited a repository with no .gitignore and need to retroactively clean it up
  • When contributing to an open source project that requires a .gitignore update in your pull request

Examples

Node + macOS

Input
Presets: Node, macOS
Expected result · Scroll for more
node_modules/
npm-debug.log*
yarn-error.log*
.pnpm-store/
.env
dist/
coverage/
.DS_Store
.AppleDouble
.LSOverride
Icon?
._*
.Spotlight-V100
.Trashes

Python + JetBrains

Input
Presets: Python, JetBrains
Expected result · Scroll for more
__pycache__/
*.py[cod]
.pytest_cache/
.mypy_cache/
.venv/
venv/
build/
*.egg-info/
.idea/
*.iml
*.iws
*.ipr
out/

Go + .NET (shared bin/ written once)

Input
Presets: Go, .NET
Expected result · Scroll for more
bin/
pkg/
*.test
coverage.out
*.exe
*.out
obj/
*.user
*.suo
*.pdb
*.cache

Tips

  • Add the macOS preset even if only part of your team uses a Mac — it stops .DS_Store and other Finder files from slipping into commits. Windows users should add Thumbs.db and desktop.ini by hand.
  • Place your most project-specific ignores at the bottom of the generated file with a comment block so they are easy to find and update later
  • If node_modules or a similar heavy directory is already tracked, run git rm -r --cached node_modules and re-commit to stop tracking it without deleting it from disk
  • Use the ! negation prefix to un-ignore a specific file inside an ignored directory, such as !dist/.gitkeep to preserve an empty placeholder folder
  • Commit your .gitignore as the very first or second commit in a project, ideally before any other files are added, to avoid having to retroactively untrack accidentally staged files

Frequently Asked Questions

Which stacks can I pick?
Nine presets: Node, Python, Java, Go, Rust, .NET, macOS, VSCode and JetBrains. Docker, Windows, Linux, Vim, Emacs and frameworks such as React are not included, so add their patterns by hand if you need them.
Can I select several stacks at once?
Yes. Tick any combination, or use Select all options. The generator merges the selected presets into one list and removes lines that appear in more than one preset.
Does the generated file ignore .env files?
Only the Node preset adds .env. If your project keeps secrets in .env, .env.local or similar files under another stack, add those lines yourself before your first push.
Why is Cargo.lock in the Rust preset?
The Rust preset ignores Cargo.lock. Cargo's current guidance is to commit Cargo.lock in most projects, and always for applications, so delete that line if you want reproducible builds.
What if I need to ignore a custom directory not covered by the templates?
After generating and copying the file, manually append entries for project-specific paths at the bottom. Lines starting with # are comments. Standard glob patterns like /dist/ or *.log work as expected.
How does a .gitignore differ from a .gitignore_global file?
A per-repository .gitignore applies only to that project and should be committed so all contributors benefit from it. A .gitignore_global lives in your home directory and applies to every repository on your machine, making it suitable for personal IDE or OS entries.
Will adding .gitignore untrack files already committed?
No. Once a file is tracked by git, a .gitignore entry alone will not stop git from watching it. You must run git rm --cached <file> to untrack it, then commit the removal alongside your updated .gitignore.
Is the output compatible with GitHub, GitLab, and Bitbucket?
Yes. The .gitignore format is a git standard and works identically across all hosting platforms. There are no platform-specific syntax differences.
Can I use the generated file as a starting point and edit it afterward?
Yes, and that is the intended workflow. The presets are a short baseline; review the output and add or remove lines to match your project structure.

Explore the category

Glossary

.gitignore
A plain-text file placed in a git repository directory that tells git which files and directories to leave untracked. Patterns support wildcards and directory-relative paths.
Glob pattern
A string using wildcard characters such as * (any characters) and ** (any path depth) to match groups of filenames. Git uses glob syntax to evaluate .gitignore rules.
Tracked file
A file that git already knows about because it was previously staged and committed. A .gitignore entry does not affect files that are already tracked.
git rm --cached
A git command that removes a file from git's index (stops tracking it) without deleting the file from your working directory. Used to untrack files that should be ignored.
Negation pattern
A .gitignore line starting with ! that re-includes a file or directory that would otherwise match an earlier ignore rule. Useful for keeping specific files inside ignored folders.
.gitignore_global
A user-level gitignore file configured via git config --global core.excludesfile that applies to every repository on the machine, typically used for personal editor or OS-specific ignores.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities