When I started out, I left my .env files out of .gitignore for the majority of a project and had to resort to starting a fresh repo. Was that necessary if the commits were already so far back in the history?
As I understand you can use interactive rebase and then push force. I used this way and I could not find later any mention of my secret word, I hope somebody corrects me if I'm wrong
git rebase -i{prev_commit_hash}
git push -f
PS Interactive rebase is a big topic itself, but to delete commit it's enough to write "d" or "drop" in commit line which you want to delete
say I push some api secrets to the repo. Would the second method overwrite the commit or will,say my .env file still be accessible?
When I started out, I left my .env files out of .gitignore for the majority of a project and had to resort to starting a fresh repo. Was that necessary if the commits were already so far back in the history?
As I understand you can use interactive rebase and then push force. I used this way and I could not find later any mention of my secret word, I hope somebody corrects me if I'm wrong
PS Interactive rebase is a big topic itself, but to delete commit it's enough to write "d" or "drop" in commit line which you want to delete
Oh ok. At the time I ended up deleting the repo and copy pasting my files in with an updated .gitignore. Good to know there’s a better alternative