There is some sensitive information that was committed to a repository about a month ago that I'd like to completely remove any trace of.
I'm adept at using git rebase
and know I can use this to change the commit, and answers like How to delete a 'git commit' from LOG, like it had never existed show how to just delete a commit using git rebase
.
However, the pre-rebased hash of the offending commit is still findable using
git log -p $BAD_SHA
So, even though the commit no longer appears under git log
, with the above command someone can still see the sensitive information even though it has been "deleted" using rebase.
Is there a way to essentially completely remove a SHA after it has been rebased, so that it no longer shows up using git log -p $BAD_SHA
?
Addendum: I have tried git gc --prune=all --aggressive
after rebasing, and this does not solve the problem. There is no branch either on the local or remote repository that still references the bad hash I want to get rid of.