Skip to content

Instantly share code, notes, and snippets.

@umamiMike
Last active March 8, 2016 04:07
Show Gist options
  • Save umamiMike/1de92e420085df5f1337 to your computer and use it in GitHub Desktop.
Save umamiMike/1de92e420085df5f1337 to your computer and use it in GitHub Desktop.
Remove a file from git history
!#/bin/bash
#will remove the file and all traces of it from your git history.
# Good for removing the accidental large bin file
# or maybe some sensitive data you accidentally committed
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch THEFILENAME HERE' --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