I have a django project that I've kept private for a long period of time. Through the lifespan of the project I've had settings.py
, base_settings.py
, and secret_settings.py
files with sensitive information. Now I've decided to make the code open source as I am no longer actively working on the project.
I ran the commands below to remove the history of these files to make sure all sensitive information was gone.
git filter-branch -f --tree-filter 'rm -f exchange/secret_settings.py' HEAD
git filter-branch -f --tree-filter 'rm -f exchange/base_settings.py' HEAD
git filter-branch -f --tree-filter 'rm -f exchange/settings.py' HEAD
However, github warned me that there was still commits that had .py~ files with AWS information in them so I ran:
git filter-branch -f --tree-filter 'rm -f exchange/settings.py~' HEAD
I have secured my AWS account and removed all the secret keys from AWS so my account is secure. However, now I have duplicated commits, sometimes 3 or 4, for my entire commit history.
I've found various answers saying I can revert back to some .git/refs
backups but that doesn't seem to be working.
Here is the project: https://github.com/ProgrammingJoe/Texchange
Does anyone know what I can do to fix this?