Recently I got this error twice:
The first time i got it was when I committing a big file (bigger than 100M) and I got the error when i try to push it to github. And github response me a error which shows 100M limitation.
However, even I have deleted the file and commit and push, github still give me the error.
Reason: Even I have deleted it, but the 100M file still in my commit history which haven't push to github. So when i push, it will be push into github.
The second time i got it was when I push a commit from codeship to heroku. This commit contains 40 images, they are 200M+. the error is:
Compiled slug size: 345.4MB is too large (max is 300MB).
Heroku didn't mention I have reach the limitation of my space.
So i did all images and push, then i got another error :
error: pack-objects died of signal 13
Reason: same reason as I did in the first time I met the issue. even I have delete them, but they are still in the history which will be pushed into heroku git as well.
I tried different ways to remove the commit history, but this one is the easiest one:
1. download the tool -- a jar file (you must have java installed)
2, do a mirror clone:
3. delete big files by the tool: (we still outside of the project folder)
$ git clone --mirror git://example.com/my-repo.git
$ javar -jar bfg.jar --strip-blobs-bigger-than 2M my-repo.git
$ cd my-repo.git $ git reflog expire --expire=now --all && git gc --prune=now --aggressive
$ git push