Created
February 20, 2012 01:33
-
-
Save underhilllabs/1867083 to your computer and use it in GitHub Desktop.
Remove passwords from files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
original source:
http://kevin.vanzonneveld.net/techblog/article/git_migration_remove_passwords_from_history/