Skip to content

Instantly share code, notes, and snippets.

@underhilllabs
Created February 20, 2012 01:33
Show Gist options
  • Save underhilllabs/1867083 to your computer and use it in GitHub Desktop.
Save underhilllabs/1867083 to your computer and use it in GitHub Desktop.
Remove passwords from files
# take password out of all java files and all git history
git filter-branch -f --tree-filter 'git ls-files -z "*.java" |xargs -0 perl -p -i -e "s#Secr3tpassw0rd#xXxXxXxXxXx#g"' -- --all
git gc --aggressive --prune
# use -f to force push if already on github
git push -f github master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment