Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

git - Error while pushing to github repo

I receive the following error when pushing my commits

remote: warning: File var/log/system.log is 57.82 MB; this is larger than recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: 96d01231dffac3fbc3ba1eb2e9f01a93
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File var/report/752246136671 is 100.86 MB; this exceeds github's file size limit of 100 MB

I tried the following the commands listed step by step below:

git push -u origin master

cant find these in git files to commit when i typed git status.

Could you please let me know how to push my changes to repo without these errors ? I guess these files are in github index . I also tried git rm --cached var/log/system.log. but no results.

hitting my head to wall !

UPDATE 1 Kindly find the Gists here based on the two answers from experts below:

UPDATE 2 Kindly find below the git Log details for the both the files that i tried to remove:

ANSWER THAT WORKED

Please find the gist for the final answer that solved my issue

credits to git experts VonC, Holger Just and all other experts who have provided their inputs and ofcourse to stackoverflow.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

git rm or git rm --cached isn't enough to remove that file fir the history stored in your repo.

You need to:

  • use BFG Repo Cleaner, as suggested above.

    bfg --strip-blobs-bigger-than 1M  my-repo.git
    
  • use git gc --agrressive --prune=now (after BFG), as detailed in "Reduce git repository size"

  • git push -f to force the new history on your remote repo.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...