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

You committed a password and pushed. Is `git rm` plus a new commit enough?

AdvancedConceptGitHub features, history rewriting and scale
Answer

No. The secret remains in history and in every clone and fork. First rotate or revoke the credential, since that is the only real fix. Then optionally remove it from history with git filter-repo, force-push, and ask GitHub support to purge cached views and PR refs.

git filter-repo --replace-text <(echo 'AKIA...==>REMOVED')
git push --force --all && git push --force --tags
All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub features, history rewriting and scale