filter-repo

Oh no! I've committed a secret to my repository, and pushed the changes!

Can't I just amend the commit and force push?

Even if you force push, the commit will still exist somewhere in the git in remote

git-filter-repo is an add-on to git that allows you to remove secrets from your git completely. Remember that, even if we amend a commit, the commit that contains our secrets still remain in the tree. We'll need a way to remove that

Not found

Once you've installed git-filter-repo, run:

git-filter-repo --force --invert-paths --path <path-to-secret>

Last updated