2

When pushing to github I currently getting an error. I have since gone into the directories using the OSX command line and rm file libv8_base.a. Then I , used git add -u, then git commit, then pushed to github. I received the same error a second time. This is a rails app.

remote: error: File vendor/bundle/gems/libv8-3.16.14.3-x86_64-darwin-13/vendor/v8/out/x64.release/libv8_base.a is 122.97 MB; this exceeds GitHub's file size limit of 100 MB

  • So you have a huge file in your history? Then rebase or filter-branch to get rid of it. After `git rm` it's still in the previous commits. – Fred Foo Apr 18 '14 at 13:47

1 Answers1

3

When you push, it transfers all new objects to the remote. This includes all new commits and all the new trees and blobs they refer to. If you remove the huge file from the newest commit, it's still there in the previous one that you're trying to push.

You have to rewrite history so that no commit refers to the huge file. Git provides the filter-branch command for this. But there are countless other ways to do this.

git filter-branch --tree-filter 'rm -f vendor/bundle/gems/libv8-3.16.14.3-x86_64-darwin-13/vendor/v8/out/x64.release/libv8_base.a' HEAD
git push -f
SzG
  • 12,333
  • 4
  • 28
  • 41