I would like to know how do I delete the sensitive data (passwords and etc) from the commit of a remote repository, but holding on to another? I explain:
I have a repository in Github and another in Heroku, my project is pointing to the two repositories. When uploading in heroku I need to leave the sensitive data as database password, AWS and etc. In Github this information should not rise, but when I give a "git add." and then a "git commit -m ..." this commit stays on the stage, I can send it to Heroku only by giving a "git push heroku", but when I need to change something in the project and send it to github this time sensitive information will be visible in this penultimate commit, was confused, but it became clear rs?
Note: it is not a matter of not observing the file, but excluding a commit of the stage (which contains the sensitive data), keeping other changes from the last commit.