Git Push遥控器:致命:包装超过最大允许尺寸 [英] Git Push remote: fatal: pack exceeds maximum allowed size
问题描述
我收到了一个大项目.客户端希望将其添加到github.
I received a large project. Client wanted to add it to github.
我正在一点一点地添加.然后发生的事情是我变得贪婪,一次添加了太多文件.现在,无论我尝试什么,我都会不断收到此错误.我怎样才能解决这个问题?我试图回滚,但也许我做错了.
I was adding bit by bit. Then what happened was I got greedy and added too many files at once. Now, no matter what I try, I keep getting this error. How can I fix this? I tried to roll back but maybe I did it wrong.
$ git push
Enter passphrase for key '/c/Users/guestaccount/.ssh/id_rsa':
Enumerating objects: 35931, done.
Counting objects: 100% (35931/35931), done.
Delta compression using up to 12 threads
Compressing objects: 100% (35856/35856), done.
remote: fatal: pack exceeds maximum allowed size
fatal: sha1 file '<stdout>' write error: Broken pipe
error: remote unpack failed: index-pack abnormal exit
To github.com:(mygithubid)/(repo).git
! [remote rejected] main -> main (failed)
error: failed to push some refs to 'github.com:(mygithubid)/(repo).git'
我正在使用Visual Studio Code和git bash上传.
I am using Visual Studio Code and git bash to upload.
推荐答案
首先,您可以使用 git-sizer 了解一下当前本地存储库中占用太多空间(您无法推送)
First, you can use git-sizer to get an idea of what is taking too much space in your current local repository (that you fail to push)
-
如果是因为提交太大,则可以:
if it is because of a commit too big, you can:
- git reset @〜取消该提交
- 重新制作一些较小的提交
- 尝试并再次推动
如果是因为文件太大,则可以尝试激活 Git LFS ,但这受到配额的限制,超过此限制可能会包含非免费服务.
if it is because of a file too big, you can try and activate Git LFS, but that is limited by quota and going above might include a non-free service.
通常,大型项目"可能需要分成几个Git存储库.
More generally, a "large project" might need to be split up into several Git repositories.
这篇关于Git Push遥控器:致命:包装超过最大允许尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!