使用Rails推送到gihub错误 [英] pushing to gihub error using Rails
问题描述
当推送到github时,我当前遇到错误.从那以后,我使用OSX命令行和rm文件libv8_base.a进入目录.然后我,使用git add -u,然后git commit,然后推送到github.我第二次收到相同的错误.这是一个Rails应用.
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.
远程:错误:文件供应商/捆绑/宝石/libv8-3.16.14.3-x86_64-darwin-13/vendor/v8/out/x64.release/libv8_base.a为122.97 MB;这超出了GitHub的文件大小限制100 MB
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
推荐答案
按下时,它会将所有新对象传输到遥控器.这包括所有新提交以及它们引用的所有新树和Blob.如果您从最新的提交中删除了巨大的文件,那么您要推送的上一个文件中仍然存在该文件.
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.
您必须重写历史记录,以便没有提交引用大文件. Git为此提供了filter-branch
命令.但是还有无数其他方法可以做到这一点.
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
这篇关于使用Rails推送到gihub错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!