Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github file size limit changed 6/18/13. Can't push now

Tags:

git

github

How does this change as of June 18, 2013 affect my existing repository with a file that exceeds that limit? I last pushed 2 months ago with a large file.

I have a large file that I have removed locally but I can not push anything now. I get a "remote error" ... remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB

I added the file to .gitignore after original push... But it still exists on remote (origin)

Removing it locally should get rid of it at origin(Github) right? ... but ... it is not letting me push because there is a file on Github that exceeds the limit...

https://github.com/blog/1533-new-file-size-limits

These are the commands I issued plus error messages..

 git add . git commit -m "delete cron_log.log" git push origin master  remote: Error code: 40bef1f6653fd2410fb2ab40242bc879 remote: warning: Error GH413: Large files detected. remote: warning: See http://git.io/iEPt8g for more information. remote: error: File cron_log.log is 141.41 MB; this exceeds GitHub's file size limit of 100 MB remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB  To https://github.com/slinds(omited_here)/linexxxx(omited_here).git  ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://github.com/slinds(omited_here) 

I then tried things like

git rm cron_log.log git rm --cached cron_log.log 

Same error.

like image 414
slindsey3000 Avatar asked Jun 29 '13 16:06

slindsey3000


People also ask

Can't push to GitHub because of large file?

You need to clean the Git history of your project locally, removing the unwanted big files from all of history, and then use only the 'cleaned' history going forward. The Git commit ids of the affected commits will change.

What is the maximum file size I can push in Git?

Maximum file size is 100MB Each file size will be limited to 100MB. If the file size exceeds the limit, you will receive an error message and the push will be blocked.

How do I increase file size limit in GitHub?

Note: If you add a file to a repository via a browser, the file can be no larger than 25 MB. For more information, see "Adding a file to a repository." GitHub blocks pushes that exceed 100 MB. To track files beyond this limit, you must use Git Large File Storage (Git LFS).


1 Answers

As rlb.usa noted, Github has added a file size limit that prevents you from pushing files > 100MB. You tried to remove the file in a new commit and tried to push that. That fails, because you are not just pushing that last commit, but also three others. Those three commits contain versions of cron_log that are 141MB and 126MB in size. They cause your push to fail.

To fix that, you have two options:

  • Run git rebase -i origin/master, set every commit to edit and remove the file in each with git commit --amend.
  • Use the BFG Repo-Cleaner to clean all your history.
like image 123
Chronial Avatar answered Sep 23 '22 15:09

Chronial