.gitignore, done right.
The most damaging git mistake is committing a .env — once pushed, the secret is in history forever, and bots find it in minutes. Pick your stack and get a .gitignore that keeps secrets, dependencies, build output, and editor junk out of version control.
The commit you can’t take back
Git history is permanent by design, which is wonderful for code and terrible for secrets. The moment a .env or a key is pushed to a remote, it is effectively public — deleting it in a later commit leaves it sitting in history, and automated scanners crawl public repos for credentials constantly. A correct .gitignore, in place before your first commit, is the cheap insurance against the single most common way developers leak production secrets.
Keeping secrets out of git is one habit in a larger discipline: secrets belong in a controlled, auditable place, not scattered through repos, configs, and chat. Managing that across the backend you own is part of what a control plane is for.
Secrets out of git, into a vault.
Infraveil runs your backend on servers you own with secrets managed and access audited — one controlled place for credentials, not a trail through your git history.
See how it worksGet the secure-build playbook
Secrets, ignore files, and repo hygiene for a backend you run yourself. No spam.