当前位置: 首页 > 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

http://www.xdnf.cn/news/989785.html

相关文章:

  • 6.11 MySQL面试题 日志 性能 架构
  • 深入理解TCP以及三次握手与四次挥手
  • 面对多个项目并行,协作机制如何建立?
  • Java 8 Stream 流详细教程 - 全面指南
  • 重塑未来的力量:人工智能的技术演进与产业变革
  • git的5种分支分别是干嘛的,git常用指令
  • git的常用方法
  • 交换机上抓包
  • 大模型与人工智能
  • 了解shell中的Fork炸弹
  • Java并发编程实战 Day 17:CompletableFuture高级应用
  • 种子音乐携手RBW 精心打造Solar颂乐首支中文单曲《Floating Free》
  • 单端的时钟阻抗设置为50欧姆,差分的时钟阻抗设置为100欧姆
  • echarts 地图 海南省全岛完整展示
  • Vuex 中Mutation 和Action介绍
  • Android SDK Manager 2025镜像,亲测好用
  • Windows为何总在不停更新补丁
  • EtherCAT转CANopen网关实现与伺服系统连通的配置实例探究
  • linux虚拟机磁盘容量不足?一个指令解决问题
  • 国内各种AI工具库
  • 大模型笔记_检索增强生成(RAG)
  • ABC 337
  • Arduino入门教程:0、课程介绍认识Arduino
  • 餐厅商家怎么做元宵节活动宣传海报?
  • C++ 精简知识点
  • 推荐算法介绍-基础算法
  • python打卡第49天
  • Unity | AmplifyShaderEditor插件基础(第九集:旗子进阶版)
  • Nginx完全学习指南 - 从入门到实战
  • xilinx的GT配置说明(一)