Skip to content

Instantly share code, notes, and snippets.

@kapb14
Created April 29, 2016 10:44
Show Gist options
  • Select an option

  • Save kapb14/20e548dd382e5844f65b241738b91bcf to your computer and use it in GitHub Desktop.

Select an option

Save kapb14/20e548dd382e5844f65b241738b91bcf to your computer and use it in GitHub Desktop.
remove file from git history (with 'git filter-branch' + 'git rm')
cd /repo/dir
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment