QA
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→

More Git & GitHub Interview Questions

Beginner LevelGit & GitHub

Compare git rebase versus git merge and explain how git bisect finds regressions.

Beginner LevelGit & GitHub

What is the difference between git init and git clone?

Beginner LevelGit & GitHub

What are the Three Trees in Git (Working Directory, Staging Area / Index, Commit History)?