You should use BFG Repo-Cleaner.
According to the website:
The BFG is a simpler, faster alternative to git-filter-branch for cleansing bad data out of your Git repository history:
- Removing Crazy Big Files
- Removing Passwords, Credentials & other Private data
The classic procedure for reducing the size of a repository would be:
git clone --mirror git://example.com/some-big-repo.gitjava -jar bfg.jar --strip-biggest-blobs 500 some-big-repo.gitcd some-big-repo.gitgit reflog expire --expire=now --allgit gc --prune=now --aggressivegit push