๐Ÿšซ .gitignore Generator

Select presets
.gitignore
# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
dist/
build/
.env
.env.local

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

# VS Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

Combine commonly used presets โ€” Node.js, Python, Java, macOS, Windows, VS Code, JetBrains, React, Next.js, and more โ€” to generate a .gitignore file. Handy for quickly setting up the right exclusion rules when starting a new project.

How to use

  1. Click to select the presets you want to include (languages, frameworks, OS, editors, etc.).
  2. The content from your selected presets is combined and shown automatically.
  3. Use "Copy" to copy it to your clipboard, or "Download" to save it as a .gitignore file.

How the calculation works

A .gitignore file tells Git which files and folders not to track. This tool combines standard presets for common environments and operating systems into one .gitignore. Each selected preset is added under a heading comment such as "# Node.js", separated by blank lines. The main pattern rules are: โ€ข node_modules/: a trailing "/" matches only directories โ€ข *.log: "*" matches any characters except the directory separator โ€ข **/temp: "**" matches directories at any depth โ€ข !.vscode/settings.json: a leading "!" re-includes something an earlier line excluded โ€ข #: a leading "#" starts a comment The download button saves the result as a file named .gitignore.

Worked example

Output with Node.js and macOS selected (excerpt) # Node.js node_modules/ npm-debug.log* dist/ .env .env.local # macOS .DS_Store ._* .env holds secrets such as API keys and passwords, so always exclude it to avoid publishing it to GitHub by mistake.

Things to be aware of

  • Files Git already tracks are not removed just by adding them to .gitignore. Untrack them with "git rm --cached filename".
  • OS and editor files (.DS_Store, .vscode/ and so on) can instead go in a global .gitignore for your whole machine.
  • On Windows the downloaded file may be saved as "gitignore" without the leading dot. Rename it to ".gitignore" if so.

FAQ

Can I select multiple presets at once?

Yes, you can select as many presets as you need, and each one's content is combined into sections in the output.

How do I add my own custom exclusion patterns?

Download or copy the generated content, then add your own lines directly in a text editor.

Can I append this to an existing .gitignore?

Yes, copy the output and paste it at the end of your existing .gitignore file.