Documentation ¶
Overview ¶
Sanitize
I use this in git clean/smudge filters to filter files that I don't want to check in as is.
For example:
In this example my working copy of the file `my_private_file.config` has my real credentials.
However when I put this sanitize tool on my path and modify my git config like this it causes the sensitive data in `my_private_file.config` to be replaced per my configuration in `.git/config` before being added to the repository.
my_private_file.config:
username=john.weldon password=s3krit
.gitattributes file:
my_private_file.config filter=sanitize
.git/config file:
[filter "sanitize"] clean = sanitize "/john.weldon/sample.username/" "/s3krit/sample.password/" smudge = sanitize "/sample.username/john.weldon/" "/sample.password/s3krit/" required
Click to show internal directories.
Click to hide internal directories.