Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while pushing to github repo

Tags:

git

github

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:

  • answer#1 - https://gist.github.com/haijerome/9405598
  • answer#2 -https://gist.github.com/haijerome/9405492

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

  • https://gist.github.com/haijerome/9406273
  • https://gist.github.com/haijerome/9406263

ANSWER THAT WORKED

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

  • https://gist.github.com/haijerome/9478989

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

like image 825
Haijerome Avatar asked Mar 06 '14 14:03

Haijerome


1 Answers

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.
like image 141
VonC Avatar answered Sep 19 '22 05:09

VonC