Skip to content

Instantly share code, notes, and snippets.

@betawax
Created July 27, 2022 18:05
Show Gist options
  • Save betawax/19fa6fdf88d759eff99f0de55d9e36cc to your computer and use it in GitHub Desktop.
Save betawax/19fa6fdf88d759eff99f0de55d9e36cc to your computer and use it in GitHub Desktop.
Replace a string in the entire Git history
git filter-branch --tree-filter 'if [ -f README.md ]; then sed -i "s/foo/bar/g" README.md; fi' HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment