Guides
Practical answers for developers: where to keep API keys, what to do after a leak, and how to stop .env files from spreading.
- .gitignore isn't enough: how secrets still end up in git.gitignore only stops files git isn't tracking yet. The ways .env files still get committed or published, how to check every branch, and how to fix it.
- Block secrets with a pre-commit hook in 5 minutesA tested pre-commit hook that stops API keys and .env files before git commits them: gitleaks, a file-name check, and what GitHub push protection adds.
- How to remove an API key from git history (rotate first)Rotate the key, then remove it from every commit with git filter-repo, force-push, and clean up old clones, forks and GitHub's cached views. Tested commands.
- .env files: how they leak, and safer ways to load secretsAre .env files secure? They're plain text, and they leak through git, web servers, Docker images and AI agents. Six real leak paths, with fixes for each.
- Where should you store API keys on a Mac?Keychain, .env files, shell exports, a password manager or a developer vault: what each one protects, how scripts and AI agents reach it, and which to pick.
- Pushed an API key to GitHub? Do this in the next 10 minutesLeaked an API key in a public repo? Revoke it first, check what it was used for, then clean the history. The steps, and rotation links for 20 providers.