How to use gitignore
- 1. Toggle stacks. Node and Next on by default.
- 2. Copy the file. Commit it at the repo root.
- 3. Add secrets patterns. .env is included in Node.
- 4. Don't ignore source. Review before you paste into a monorepo.
About this tool
A good .gitignore is cheaper than scrubbing history. These templates are starting points, not your company policy.
Next vs Node
Next adds .next/ and next-env.d.ts. Node covers node_modules and dist.
Android
APK/AAB and Gradle — not a full Android Studio ignore.
LICENSE and SPDX
A new repo usually needs a .gitignore and a LICENSE. After you copy the ignore file, pick an SPDX license identifier (MIT, Apache-2.0, GPL-3.0-only, etc.) and generate a LICENSE stub with the SPDX License tool.
Code examples
snippet
node_modules/
.env