GitHub 页面、下载与终端为何会分别超时
GitHub 网页、Release 文件与 SSH 握手走的请求不同。网页能打开时,仍可分别排查 Fastly、AWS CloudFront 等静态资源或下载路径涉及的 DNS 解析和 TCP 丢包。 网页样式缺失、克隆进度停滞或大文件下载中断时,可分别记下出问题的请求,再核对它实际经过的连接。
遇到代码提交或构建挂起时,先找出最先失败的命令,再对照连接配置。
Git 的 HTTP 代理设置
设置 Git 的全局代理。示例使用本地端口 7890。
git config --global --replace-all http.proxy http://127.0.0.1:7890
git config --get http.proxy
git config --get http.proxy
仅为 github.com 设置代理。Gitee 和内网 GitLab 分别依照各自适用的配置连接。
git config --global --replace-all "http.https://github.com.proxy" http://127.0.0.1:7890
git config --get-urlmatch http.proxy https://github.com
git config --get-urlmatch http.proxy https://github.com
取消全局或 GitHub 单独设置的代理
git config --global --unset-all http.proxy
git config --global --unset-all "http.https://github.com.proxy"
git config --global --unset-all "http.https://github.com.proxy"