问题现象
某个已经有5年的仓库,也是公司最大的仓库(设计人员内容应该保存了不少素材之类),推送到gitlab上报错:
Enumerating objects: 13601, done.
Counting objects: 100% (13601/13601), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4405/4405), done.
remote: fatal: pack exceeds maximum allowed size
remote:
remote: ========================================================================
remote:
remote: stdin send error: EOF
remote:
remote: ========================================================================
remote:
fatal: sha1 file '<stdout>' write error: Broken pipe
error: remote unpack failed: index-pack abnormal exit
error: failed to push some refs to 'git@192.168.3.111:product/product-design.git'
可以明显看到是index-pack太大,导致gitlab服务端报错,尝试在后台修改了一系列大小有关的参数后上传仍然无效,使用https和ssh也无法解决。
解决
查看了一堆文档,都是说使用lfs或者分段提交等,没有很好的解决办法。
终于发现了一个简单的方式,尝试了一下,成功了:
git push --no-thin