I have a private repo where I developed a bunch of scripts for my personal use. I then got sloppy and pushed info without writing a gitignore and left my personal access tokens hardcoded directly into the script. Now, quite a few people are asking for the scripts and so I've decided to publish the git repo. However, I understandably need to remove the access tokens from the git history. I'm the only person that uses the repo as of right now.
I do, however need the commits to stay separate for a host of other reasons (so I can't make the change and squash all commits). I understand that I can remove the files involved, but the access tokens are in the main script file itself. Thus, I'd like to remove/edit that line in a previous commit and have it carry over to newer commits.
How would I do this?