Skip to content

Instantly share code, notes, and snippets.

@abbasnaqdi
Last active July 6, 2018 14:57
Show Gist options
  • Save abbasnaqdi/53d1044a71501ef3cc1d7a942d235d4c to your computer and use it in GitHub Desktop.
Save abbasnaqdi/53d1044a71501ef3cc1d7a942d235d4c to your computer and use it in GitHub Desktop.
git ignore force for all history
//use this comment in terminal in project directory
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 origin --force --all
//or
bfg --delete-files YOUR-FILE-WITH-SENSITIVE-DATA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment