sanitize

command
v0.0.0-...-291e031 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2016 License: MIT Imports: 6 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL