Skip to content

Instantly share code, notes, and snippets.

@REDNBLACK
Last active August 29, 2015 14:07
Show Gist options
  • Save REDNBLACK/dcee98f2b1e75cd0d561 to your computer and use it in GitHub Desktop.
Save REDNBLACK/dcee98f2b1e75cd0d561 to your computer and use it in GitHub Desktop.
Заменить/удалить длинный, нежелательный текст во всех коммитах в истории Git

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' {} ;"\

Также линк для более подробной инфы: https://help.github.com/articles/remove-sensitive-data/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment