刚才的问题解决了,但pullpush的时候又出现The remote end hung up unexpectedly,如何解决?
本地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
1
2
修改 git 缓存大小 (这里给出的是全局的,也可以设置该文件夹的,也可以从config文件中添加/修改大小)
git config --global http.postBuffer 524288000
强制推送
git push -u origin master -f
Git仓库或文件较大,可以尝试将Http缓存设置大一些,比如1G:git config --global http.postBuffer 1048576000,或者3G 3194304000。然后重试
查看原因有三种可能:要么是缓存不够,要么是网络不行,要么墙的原因
可以配置git的最低速度和最低速度时间:
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
造成的原因就是推送代码的大小超出了git默认的范围,可以调整git推送代码的最大值,找到项目中的.git文件夹。
找到.git文件夹之后,点击进入,找到其中的“config”文件,也就是git的配置文件。
然后在打开config配置文件,在最底下增加如下的配置:
[http]
postBuffer = 524288000
此时重新执行git push命令,代码就可以成功的推送到代码仓库
The remote end hung up unexpectedly
远端意外挂断