![]() Run git redact on a repo that's already been redacted. Based on your yea or nay, it finishes by telling you whether the original or redacted files are ready for staging. ![]() Git-redact will do its thing, show you a list of all the changes it's made in each file and ask you to approve. Redaction should always happen before adding files for a commit. Work as usual until you're ready to commit. redacted_originals (note the leading dot.) You can make these yourself or git-redact will create them if it sees they're missing.Īdd patterns to. Switch to the repo in which you'll be redacting. gitredact note the hyphen and leading dot.) somewhere your $PATH environment variable will see it, like /usr/local, if you've set it up. How to use it Set upĬlone this repo and move the git-redact file (not to be confused with. Hit 'n' and it deletes the redacted copies, moves the originals back into the directory under their old names, prints a confirmation and exits 1. Hit 'y' and it prints a confirmation message and exits 0. The copies, which have now been redacted, are what Git will see when it's time to stage files for committing.Īt this point, git-redact prints a list of all the changes it's made and asks if you approve. Your original files are copied to an ignored backup directory and renamed. All the deletions and replacements are done with sed. Using this list, it writes a sed file and instructions, which it runs on each file that's been modified since the last commit. You supply git-redact with a list of terms to remove or replace. gitredact file, in the same set-it-and-forget-it way you'd use. Or, you know, passwords.įor now (1), you'll run this utility before git add, stripping out the unwanted values before you commit them. Git-redact is a utility to automate the removal of stuff you don't want in your repo before publishing, like console.log().
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |