[Solved] remote: fatal: pack exceeds maximum allowed size - Github
If you are working on a large project and want to push the whole project in Github you may face an error that says,
remote: fatal: pack exceeds maximum allowed size
Github recommends that repositories be kept modest, with a maximum size of 1 GB and less than 5 GB is strongly recommended. So if you want to push a large project or a large commit here are some methods shared in this article.
Method 1:
If a single large commit exceeds the git server's limit, you can make sub-commits and merge commits to solve a single large commit with several files (for example, file1, file2,..., file10).
$ git checkout -b tmp SINGLE_LARGE_COMMIT^ $ git add file1 file2 file3 file4 # add a sub-class of files inside SINGLE_LARGE_COMMIT $ git commit -m 'sub-commit' $ git push origin tmp $ git merge master # or any other branch which contains SINGLE_LARGE_COMMIT $ git push origin tmp $ git checkout master $ git push origin master
Method 2:
You can divide the whole project into some smaller commits and push several times to push the whole project. If you already tried and failed to push then reset the last commit and try again.
- git reset @~ to cancel that commit
- make several smaller commits
- try and push again
Method 3:
If you want to make a large project professionally with too big files, you can try Git LFS, but that is limited by quota, and going above might include a non-free service.
Thank you for reading the article. Hope it may solve your problem.To learn more about git you can check Git Complete: The definitive, step-by-step guide to Git course.