Skip to content

Instantly share code, notes, and snippets.

@marcobarbosa
Created August 31, 2015 15:19
Show Gist options
  • Save marcobarbosa/f159f18b80f332f671ba to your computer and use it in GitHub Desktop.
Save marcobarbosa/f159f18b80f332f671ba to your computer and use it in GitHub Desktop.
Remove binary from GIT history
#!/usr/bin/env bash
git filter-branch --index-filter 'git rm -r -q --cached --ignore-unmatch '$1'' --prune-empty --tag-name-filter cat -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment