Git常见错误整理

错误1:Git: fatal: The remote end hung up unexpectedly

解决办法:

> git config --global http.postBuffer 1048576000
> git config --global http.postBuffer 1048576000

错误2:Git error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54

错误信息:

Total 116323 (delta 81906), reused 116320 (delta 81905)
POST git-receive-pack (130907163 bytes)
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

git 在 pull 或者 push 一个大项目时,可能会碰到出现如题所示的错误。

解决办法:
网络上往往都会说这是由于大文件造成的提交或者拉取失败。但是,经过本人测试,如果是 errno 56,那么应该是有大文件或者提交缓存方面的问题。而 errno 54 则不是这个问题。对于 56 错误的解决方式与网络上大部分文章的一致。都是增大缓存配置,比如下面就是配置提交缓存为 500M。

> git config http.postBuffer 524288000
> git config https.postBuffer 524288000

对于 errno 54 这个错误,经尝试 http 或者 https 协议都无法正常提交。必须改为 ssh 方式来提交代码。也就是必须使用公私钥的方式进行账号验证,并提交代码。
Git配置SSH Key请参考 Git配置SSH Key

错误3:error:The branch ‘testing’ is not fully merged

解决办法:强制删除

# 普通删除
git branch -d branch_name

# 强制删除
git branch -D branch_name

错误4:fatal:multiple stage entries for merged file

rm .git/index
git add -A
git commit

欢迎订阅「K叔区块链」 – 专注于区块链技术学习

《Git常见错误整理》

博客地址:
http://www.jouypub.com

简书主页:
https://www.jianshu.com/u/756c9c8ae984

segmentfault主页:
https://segmentfault.com/blog/jouypub

腾讯云主页:
https://cloud.tencent.com/developer/column/72548

    原文作者:JouyPub
    原文地址: https://segmentfault.com/a/1190000015915765
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞