Gitlab-无法推送到存储库只是挂起

时间:2020-04-19 17:40:40

标签: git gitlab

无法推送到主服务器,控制台只是冻结而没有任何响应。只有在跑步之后

git config --global http.postBuffer 524288000

git push可以正常工作。

尽管该设置似乎是一次,但使用git push时的下一次却出现了相同的问题。 有替代解决方案吗?为什么会突然发生这种情况?

编辑:

OpenSSH_7.9p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/name/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug2: resolving "gitlab.com" port 22 debug2: ssh_connect_direct debug1: Connecting to gitlab.com [2606:4700:90:0:f22e:fbec:5bed:a9b9] port 22. debug1: Connection established. debug1: identity file /Users/name/.ssh/id_rsa type 0 debug1: identity file /Users/name/.ssh/id_rsa-cert type -1 debug1: identity file /Users/name/.ssh/id_dsa type -1 debug1: identity file /Users/name/.ssh/id_dsa-cert type -1 debug1: identity file /Users/name/.ssh/id_ecdsa type -1 debug1: identity file /Users/name/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/name/.ssh/id_ed25519 type -1 debug1: identity file /Users/name/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/name/.ssh/id_xmss type -1 debug1: identity file /Users/name/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.9

1 个答案:

答案 0 :(得分:0)

您看到的是某种网络问题。您可以连接到远程系统,但无法读取远程端的版本字符串,这是它作为SSH协议的一部分发送的第一件事。

您的系统上可能有某些东西阻止数据的发送或接收,或者您的网络上有某些东西导致了这一点。您的OpenSSH版本字符串看起来像在macOS上,因此您应该检查防火墙配置。如果您在系统上安装了防病毒软件,请先将其删除,然后重新启动。有些网络会阻止SSH,因此这也可能是问题。如果尝试ssh git@github.com失败,则可能是因为您的网络中断了IPv6支持或中断了路径MTU发现,在这种情况下,您应该检查路由器。您可以尝试从另一个网络(如果有可能在当前事件发生的情况下尝试),看看是否能够解决问题,在这种情况下,您就知道问题出在网络上。

这里有很多潜在的问题,不可能一一列举。更改http.postBuffer绝对无济于事,因为这对SSH完全没有影响,仅影响服务器或代理中断HTTP / 1.1支持的HTTPS连接。除非您知道自己需要它,否则不应该设置它,因为它会导致每个HTTPS推送操作(无论大小)都会分配全部内存,因此在几乎每种情况下,它都没有好处,只会浪费大量的内存。

您也可以尝试改用HTTPS URL。有时由于某些原因,效果更好。

相关问题