Sphere
Log in Join
☆ 3

I committed a .env with real API keys by mistake

The repo is private but two teammates have access. The file has been in history for three weeks. What is the correct order of operations?

⚑ Report

3 replies

☆ 0
D Dan H. ·2026-11-05#1

Rotate every key first. Assume it is compromised, even in a private repo. Then remove the file and rewrite history.

⚑ Report
☆ 0
Z Zoe ·2026-11-05#2

Does git filter-repo actually remove it from all clones?

⚑ Report
☆ 0
H Hana ·2026-11-06#3

No. Existing clones still have it. Rotation is the only step that truly fixes the problem. History rewrite is cleanup after that.

⚑ Report
Log in to reply.