error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 解决方案 使用Git提交时报错,代码如下:
$ git push -u origin "master"
Counting objects: 100% (95/95), done.
Delta compression using up to 12 threads
Compressing objects: 100% (92/92), done.
Writing objects: 100% (94/94), 726.86 MiB | 24.37 MiB/s, done.
Total 94 (delta 8), reused 0 (delta 0)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date
bash: $: command not found
原因: HTTP上传文件限制了文件大小
此时改变git配置是没有用的,因为这跟本不是git的问题
解决方法: 更换远程仓库地址,我这里换的是SSH 第一步 修改地址
git remote set-url origin 复制的地址
第二步 重新上传
git push
另附: GitHub git push超过100MB大文件失败(write error: Broken pipe)完美解决
法2:大文件拆分上传,但需要删除先前大文件的add记录
(1)直接回滚rollback即可 (2)备选
ljylj@zzjljy MINGW64 ~/Downloads/fx_2022 (master)
$ git rev-list --objects --all | grep 6e45abf89fe51b10
6e45abf89fe51b101ec2bb0a3962b08d9166e518 408/趣谈网络协议-total.pdf
ljylj@zzjljy MINGW64 ~/Downloads/fx_2022 (master)
$ git filter-branch --tree-filter '6e45abf89fe51b101ec2bb0a3962b08d9166e518 408/xxx-total.pdf' --tag-name-filter cat -- --all
WARNING: git-filter-branch has a glut of gotchas generating mangled history
rewrites. Hit Ctrl-C before proceeding to abort, then use an
alternative filtering tool such as 'git filter-repo'
(https://github.com/newren/git-filter-repo/) instead. See the
filter-branch manual page for more details; to squelch this warning,
set FILTER_BRANCH_SQUELCH_WARNING=1.
Proceeding with filter-branch...
参考: ttps://www.it610.com/article/1495412629928214528.htm https://blog.csdn.net/weixin_53166575 仓库体积过大,如何减小?
|