Unit 9 · Ship it and keep it alive
Deleting a file doesn’t remove it from git
Git keeps every committed version of every file. Deleting the file in a new commit leaves the old version, secret included, in the history for anyone with a copy of the repository.
The mix-up
What people often think
“Once a file is deleted, git forgets what was in it.”
What the tutor says
Git keeps every version of every file. Assume a committed secret is public forever, which is why you revoke it.
How it works
Rewriting history is possible but does not reach copies others already cloned. Assume a committed secret is public forever, which is why the first step is always to revoke it.
Practise it with a tutor watching
Secrets
Respond to a leaked key in the right order: revoke first, then clean up, and know what git remembers.
Free, no account needed.