Added .env to .gitignore after committing it? Ember says too late
Detective Ember sniffs this one often: .env added to .gitignore after the first commit.
.gitignore only stops git from tracking new files. A file already committed stays tracked, and it stays in your history. Git docs
The two-minute check
- Run
git ls-files .env. If it prints the file, it's still tracked. Rungit rm --cached .env. - Run
git log --all -- .env. Any commit listed still holds your secrets, so rotate every key in it. - Then scan your own app on SniffPup. Full fixes free for every critical issue (no critical? one other fix is free).
Want one 2-minute check like this every morning? Sign up below.
Named after Ember, my black Pomeranian. Built by a software engineer and vibe-coding hobbyist to help you ship safely.