Flip your .gitignore: ignore everything by default, allow only what you need
rseroter · x · 2026-09-10
Alex Pliutau proposes an inverted .gitignore strategy: instead of allow-everything-then-ignore-junk (.DSStore, nodemodules, IDE configs, env vars, CLAUDE.md), ignore everything with and explicitly allow only needed files via ! rules like !.go, !go.mod.
- Only explicitly whitelisted files get tracked, preventing accidental commits of secrets and local junk
- He notes typescript-go carries a 207-line .gitignore, and with agents generating messy local docs, default-ignore is increasingly practical
- Includes a handy command: git check-ignore -v <path> to debug why a file isn't tracked
- Author admits it's not right for every repo, but a worthwhile alternative
More from coding & agent
- Who's Building Guardrails for the Vibe Coding Wave of Shaky Code? — DavidWells · 2026-09-10
- v0 brings Vercel integrations into chat: one-click Resend, MongoDB, Algolia and more — evilrabbit_ · 2026-09-10
- User puts computer-use agent Astra to work auditing Google Business Profiles and configuring Stripe — gregmushen · 2026-09-10
- Using an AI agent to digest Apple's 6 iPhone Duo developer videos: key iOS 27.1 takeaways — JordanMorgan10 · 2026-09-10
- Five Things You Shouldn't Vibe Code: Auth, Payments, Time Zones and More — rseroter · 2026-09-10
- Complete 2026 Guide: How to Actually Build an App with AI Without It Hurting Your Product — davemccollough · 2026-09-10