Is there a way to instruct git to hide my sensitive information. E.g.
credentials.php (in local repository).
Line1: $dbname = 'xyz'; Line2: $dbpassword = 'password';
credentials.php (in github repository and history).
Line1: $dbname = 'xyz'; Line2: $dbpassword = 'xxxxxxxx';
So git automatically hides the information with 'x'.
If not via git, how should I do it? I try and keep all my credentials in one place, but it becomes hard when you are using 3rd party libraries and they keep credentials all over the place.
Sidenote: Its not possible for me to NOT track the
credentials.php file at all because it may also contain some other logic which needs to be version controlled.
Note: I found this post with a similar question. But the answer is not satisfactory for me. Is there an automated way to do what is told in the "accepted answer" ?