Intermediate LevelGit & GitHub
How do you purge accidentally committed passwords using git filter-repo?
❓ Interview Prompt: Explain purging credentials or large files from full Git history using git filter-repo / BFG Repo-Cleaner and force-pushing consequences.
git filter-repo rewrites complete repository history to remove sensitive credentials or giant files from all historical commits. Always force-push and rotate exposed credentials immediately.
Code Implementation Example
bash
git filter-repo --invert-paths --path passwords.txt
git filter-repo --replace-text passwords-to-strip.txt💡Purging sensitive files across full commit history using git filter-repo.
🎯 Interview Key Takeaway
Use git filter-repo to purge secrets from full historical commits, and rotate exposed credentials immediately.
#git filter-repo#Security#Secret Purge#Intermediate
Back to all Git & GitHub Questions→