Skip to content

Instantly share code, notes, and snippets.

@DBasic
Forked from REDNBLACK/git_filter_branch.md
Last active August 29, 2015 14:07
Show Gist options
  • Save DBasic/85433df9d4bea743d3af to your computer and use it in GitHub Desktop.
Save DBasic/85433df9d4bea743d3af to your computer and use it in GitHub Desktop.
[git] filter git branch
str=$(cat <<'EOF'
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EOF
)
git filter-branch --tree-filter "find . -name '*.php' -exec sed -i '' -e 's/$str/**REMOVED**/g' {} \;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment