Skip to content

Instantly share code, notes, and snippets.

@diodonfrost
Created September 5, 2023 21:54
Show Gist options
  • Select an option

  • Save diodonfrost/84c98580b84b16bb5a3d6d8c9dca5265 to your computer and use it in GitHub Desktop.

Select an option

Save diodonfrost/84c98580b84b16bb5a3d6d8c9dca5265 to your computer and use it in GitHub Desktop.
Replace a string in whole Git history
# Replace the string "foo" by "bar" in all .yml files in the whole Git history
git filter-branch -f --tree-filter "find . -type f -name '*.yml' -exec sed -i -e 's/foo/bar/g' {} \;"
# Replace the string "foo" by "bar" in all files in the whole Git history
git filter-branch -f --tree-filter "find . -type f -exec sed -i -e 's/foo/bar/g' {} \;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment