Skip to content

Instantly share code, notes, and snippets.

@gelysis
Last active February 20, 2018 03:36
Show Gist options
  • Save gelysis/2798fdf76a132c229ee23686e16ff643 to your computer and use it in GitHub Desktop.
Save gelysis/2798fdf76a132c229ee23686e16ff643 to your computer and use it in GitHub Desktop.
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' --prune-empty --tag-name-filter cat -- --all
git push -f --all && git push -f --tags
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin && git reflog expire --expire=now --all && git gc --prune=now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment