Skip to content

Instantly share code, notes, and snippets.

@jasonmc
Created August 1, 2011 14:48
Show Gist options
  • Save jasonmc/1118271 to your computer and use it in GitHub Desktop.
Save jasonmc/1118271 to your computer and use it in GitHub Desktop.
Place in PATH and can call 'git redact xyz' to remove all occurenences of xyz in repo. Watch out for cached copies though.
#!/bin/bash
git filter-branch -f --tree-filter "sed -i '' -e 's/$1/REDACTED/' $FILENAME" -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment