当前位置: 首页 > news >正文

Git不能更新以及提交代码,提示链接超时,本地凭证无问题

1、pull时打印日志

GIT_TRACE=1 GIT_CURL_VERBOSE=1 git pull

输出日志:

$ GIT_TRACE=1 GIT_CURL_VERBOSE=1 git pull
14:34:19.189472 exec-cmd.c:237          trace: resolved executable dir: D:/LifeApp/Git/mingw64/bin
14:34:19.192457 git.c:460               trace: built-in: git pull
14:34:19.194450 run-command.c:654       trace: run_command: git fetch --update-head-ok
14:34:19.208970 exec-cmd.c:237          trace: resolved executable dir: D:/LifeApp/Git/mingw64/libexec/git-core
14:34:19.211936 git.c:460               trace: built-in: git fetch --update-head-ok
14:34:19.215925 run-command.c:654       trace: run_command: GIT_DIR=.git git remote-https origin https://gitee.com/servers.git
14:34:19.230919 exec-cmd.c:237          trace: resolved executable dir: D:/LifeApp/Git/mingw64/libexec/git-core
14:34:19.232880 git.c:749               trace: exec: git-remote-https origin https://gitee.com/servers.git
14:34:19.232880 run-command.c:654       trace: run_command: git-remote-https origin https://gitee.com/servers.git
14:34:19.250833 exec-cmd.c:237          trace: resolved executable dir: D:/LifeApp/Git/mingw64/libexec/git-core
14:34:19.259843 http.c:703              == Info: Couldn't find host gitee.com in the (nil) file; using defaults
14:34:19.279609 http.c:703              == Info:   Trying 181.76.199.13:443...
14:34:19.321782 http.c:703              == Info: Connected to gitee.com (181.76.199.13) port 443 (#0)
14:34:19.322788 http.c:703              == Info: ALPN: offers h2
14:34:19.322788 http.c:703              == Info: ALPN: offers http/1.1
14:34:19.337779 http.c:703              == Info:  CAfile: D:/LifeApp/Git/mingw64/ssl/certs/ca-bundle.crt
14:34:19.337779 http.c:703              == Info:  CApath: none
14:34:19.337779 http.c:703              == Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):

从调试日志来看,Git 已经成功连接到 Gitee 服务器(Connected to gitee.com (181.76.199.13) port 443),但在 TLS 握手阶段(Client hello)之后卡住,没有进一步输出。这表明问题可能出在 SSL/TLS 认证 或 网络代理拦截 上。以下是针对性解决方案

1. 检查 Git 的 SSL 证书配置

(1) 确认证书路径是否正确

日志中显示 Git 使用的 CA 证书路径:

CAfile: D:/LifeApp/Git/mingw64/ssl/certs/ca-bundle.crt
  • 检查该文件是否存在:

    ls "D:/LifeApp/Git/mingw64/ssl/certs/ca-bundle.crt"
  • 如果文件丢失,重新安装 Git 或手动下载证书包。

(2) 临时关闭 SSL 验证(测试用)
git config --global http.sslVerify false
git pull

如果成功,说明是证书问题,需修复证书路径或更新证书:

git config --global http.sslVerify true  # 恢复验证

2. 排除代理干扰

(1) 检查是否启用了代理
git config --global --get http.proxy
git config --global --get https.proxy
  • 如果返回代理地址,清除代理设置:

    git config --global --unset http.proxy
    git config --global --unset https.proxy

相关文章:

  • Binder
  • ONLYOFFICE 协作空间 企业版使用秘籍-1.如何使用外部存储
  • 达梦数据库部署veri数据对比工具
  • 3.3.2 纠错编码(海明校验码)
  • 板凳-------Mysql cookbook学习 (十--5)
  • 鸿蒙Next仓颉语言开发实战教程:订单列表
  • Spring Cloud与Alibaba微服务架构全解析
  • Android GreenDAO 通过 Key 查询数据库数据慢问题优化
  • 力扣hot100--反转链表
  • 多线程应用
  • 详细解释aruco::markdetection _detectInitialCandidates函数
  • Java八股文——Spring「MyBatis篇」
  • Linux开发工具之VsCode(Filezila、MobaXterm、Vim三合一)
  • git的常用方法
  • 【Unity优化】提高热更新和打包速度
  • 架空线路智能监控系统的应用与优势剖析
  • Android Studio 无法安装HAXM,点击之后无反应
  • Vue-Typed-JS打字动画效果
  • C#.Net 使用NPOI库导出Excel(含列宽度自适应) 及 根据Excel文件生成DataTable
  • c#实现绝对路径和相对路径的转换
  • 做网站除了买域名还有什么/seo整站优化报价
  • 做商城网站在哪里注册营业执照/广州seo学徒
  • 网站 防止采集/培训学校招生方案范文
  • 南京cms建站系统/哪些店铺适合交换友情链接
  • 如何设计制作一般的企业网站/篮网目前排名
  • 做的比较唯美的网站/新手做seo怎么做