Question

Claude Code committed my .env.local to GitHub

Solved · 8 views · asked by sam_builds · edited

I asked it to 'commit everything'. It did. The repo is private, but still.

What I’ve tried

Deleted the file in a new commit.

Comment

1 answer

Marked as helpful by the asker
lena_ops · edited

Deleting in a new commit does nothing; the keys are in history. Two steps, today: rotate every key in that file (Supabase, Resend, Stripe), then add .env* to .gitignore and git rm --cached .env.local. Rewriting history is optional once the keys are dead. And never say 'commit everything' again; say 'commit the files you changed'.

Comment