Interview Prep/Git & GitHub/GitHub features, history rewriting and scale

How do you remove a large file from the entire Git history?

AdvancedConceptGitHub features, history rewriting and scale
Answer

Rewrite with git filter-repo, then expire and gc so the objects are actually dropped, and force-push. Collaborators must re-clone or hard reset.

git filter-repo --strip-blobs-bigger-than 50M
git filter-repo --invert-paths --path assets/video.mp4
All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub features, history rewriting and scale