问题一:
原因
git 有两种拉代码的方式,一个是 HTTP,另一个是 ssh。git 的 HTTP 底层是通过 curl 的。HTTP 底层基于 TCP,而 TCP 协议的实现是有缓冲区的。 所以这个报错大致意思就是说,连接已经关闭,但是此时有未处理完的数据;
因为git项目或者文件太大造成的错误,而缓冲区太小,所以导致这个错误
解决方案
- 查看是哪个文件超过限制
中间两行:
remote: error: File libtorch/lib/libdnnl.a is 135.48 MB; this exceeds GitHub’s file size limit of 100.00 MB
remote: error: File libtorch/lib/libtorch_cpu.so is 483.09 MB; this exceeds GitHub’s file size limit of 100.00 MB
说明是bitmap.pdf这个文件太大,超过了100M的限制。所以就要处理这个文件了
- 重写commit,删除大文件
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch libtorch/lib/libtorch_cpu.so' --prune-empty --tag-name-filter cat -- --all
注意将libtorch/lib/libtorch_cpu.so替换成你的路径与文件
看到rewrite行提示重写, 说明成功
不要忘了检查本地大文件还在不
- 强制推送修改后的repo
git push origin xxx --force
xxx是你当前的分支名
参考
https://blog.csdn.net/m943917709/article/details/107554088
https://blog.csdn.net/chichoxian/article/details/106403252
https://www.cnblogs.com/yfacesclub/p/14160046.html