项目场景:
git push 报错 the remote end hung up unexpectedly
提交文件中包含一个60+M的压缩包
问题描述:
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date
原因分析:
本地git缓存不足,本次push文件内容大小过大
解决方案:
有以下几种解决方案:- 如果你的 git 是使用 http 协议的,改用ssh协议,再次 push 即可
- 运行
git remote set-url origin git@git.xxx.com:gitbook/notes.git
- 在 .git/config 文件中修改url为ssh协议url
[remote "origin"] url =git@git.xxx.com:gitbook/notes.git
- 运行
- 修改 git 缓存大小 (这里给出的是全局的,也可以设置该文件夹的,也可以从config文件中添加/修改大小)
git config --global http.postBuffer 524288000
- 强制推送
git push -u origin master -f