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
解决方案
您看到的是某种网络问题。您可以连接到远程系统,但无法读取远程端的版本字符串,这是它作为 SSH 协议的一部分发送的第一件事。
您的系统上可能存在阻止数据发送或接收的某些东西,或者您的网络上存在某些东西导致了这种情况。您的 OpenSSH 版本字符串看起来像是在 macOS 上,因此您应该检查防火墙配置。如果您在系统上安装了防病毒软件,请将其删除,然后重新启动。某些网络会阻止 SSH,因此这也可能是问题所在。如果尝试ssh git@github.com
没有挂起,那么这可能是因为您的网络破坏了 IPv6 支持或破坏了路径 MTU 发现,在这种情况下,您应该检查您的路由器。您可以从另一个网络尝试(如果可能的话)并查看是否可以解决问题,在这种情况下,您知道它在您的网络上。
这里有很多潜在的问题,不可能一一列举。绝对不会有帮助的是更改http.postBuffer
,因为这对 SSH 根本没有影响,只会影响服务器或代理已破坏 HTTP/1.1 支持的 HTTPS 连接。除非您知道自己需要它,否则不应设置它,因为它会导致每个 HTTPS 推送操作(无论多么小)分配全部内存,因此几乎在每种情况下,它都没有任何好处,只会浪费大量内存.
您也可以尝试切换到 HTTPS URL。有时由于某种原因效果更好。
推荐阅读
- javascript - NextJS _app.tsx Component 和 pageProps 应该是什么 TypeScript 类型?
- javascript - javascript:如何将数组转换为元组
- javascript - 我的按钮标签对我的 JavaScript RoR 6 没有反应
- javascript - [Route: users.update] [URI: users/{user}] 缺少必需的参数
- ajax - 使用 javascript 和 ajax 从谷歌翻译小部件转换为云 api
- javascript - JavaScript 和 Chrome 扩展:传递变量
- java - 在内存方面,大数组或多个数组哪个更好、更高效?
- r - 无法用我的正则表达式提取星号
- c++ - C++ 中的随机序列生成
- node.js - NodeJS http 重定向请求