Skip to content

Instantly share code, notes, and snippets.

@dxe4
Created April 14, 2014 09:40
Show Gist options
  • Save dxe4/10632647 to your computer and use it in GitHub Desktop.
Save dxe4/10632647 to your computer and use it in GitHub Desktop.
Delete big files from git history
git filter-branch -f --force --index-filter 'git rm -rf --cached --ignore-unmatch folder/sub-folder' --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
# http://stackoverflow.com/questions/2164581/remove-file-from-git-repository-history#answer-15526317
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment