Skip to content

Instantly share code, notes, and snippets.

@fabriceleal
Created August 29, 2013 09:24
Show Gist options
  • Save fabriceleal/6376017 to your computer and use it in GitHub Desktop.
Save fabriceleal/6376017 to your computer and use it in GitHub Desktop.
Purge a file from git's history
# From https://help.github.com/articles/remove-sensitive-data
# If you haven't done it yet:
git rm thefile.ext
# And to purge it from history
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch thefile.ext' --prune-empty --tag-name-filter cat -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment