git push 报错 the remote end hung up unexpectedly

项目场景:

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文件内容大小过大


解决方案:

有以下几种解决方案:
  1. 如果你的 git 是使用 http 协议的,改用ssh协议,再次 push 即可
    1. 运行 git remote set-url origin git@git.xxx.com:gitbook/notes.git
    2. 在 .git/config 文件中修改url为ssh协议url
      [remote "origin"]
      url =git@git.xxx.com:gitbook/notes.git
      
  2. 修改 git 缓存大小 (这里给出的是全局的,也可以设置该文件夹的,也可以从config文件中添加/修改大小)
    git config --global http.postBuffer 524288000
  3. 强制推送
    git push -u origin master -f
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值