Skip to content

Instantly share code, notes, and snippets.

@a-szotyori
Created December 21, 2016 15:12
Show Gist options
  • Save a-szotyori/4324f117c0e70d3adaf036d125698765 to your computer and use it in GitHub Desktop.
Save a-szotyori/4324f117c0e70d3adaf036d125698765 to your computer and use it in GitHub Desktop.
Delete text from files in the git history
bfg -rt expressions_file
git reflog expire --expire=now --all && git gc --prune=now --aggressive
Where expression_file contains:
Match expressions should be listed in the file, one expression per line - by default,
each expression is treated as a literal, but 'regex:' & 'glob:' prefixes are supported,
with '==>' to specify a replacement string other than the default of '***REMOVED***'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment