I just realized that I forgot to add the gitignore file, as a consequence my mongodb database link is in one of my previous commmit. Could anyone help to figure out how could I rewrite that commit without deleting it ???
I just realized that I forgot to add the gitignore file, as a consequence my mongodb database link is in one of my previous commmit. Could anyone help to figure out how could I rewrite that commit without deleting it ???
Suppose your keys are in a MY_FILE_HERE. This should do the trick:
Keep in mind that doing this you're changing the git history. Also remember to check if the file was correctly deleted from the remote repository history.
If you still want to retain the file, just add it to .gitignore.
Src: https://www.freecodecamp.org/news/how-to-uncommit-sensitive-files-from-git/