I'm looking for a way to prevent api keys and such to wind up in a public repo. (where it's hosted don't actually matter)
So I understand that the common solution is to add the file containing the api keys to .gitignore so that it basically never gets committed to the repo.
The thing is I'd rather commit the file but replace the key itself with 'YOUR API KEY HERE' sort of text in its place.
I've found this answer suggesting to use git filter branch but it seems to be really hit or miss and not really recommended.
Is there any other way to achieve this? Any way to ensure git filter branch will actually work? Any way to do it retroactively? Should it be done after git add or before it?