git pull git push长时间无响应很慢

文章描述了用户在IDEA和gitbash中使用git命令时遇到的延迟问题,定位到是由于链接到gitlab的IP地址错误。解决方法包括配置正确的gitlabIP和使用DNS服务器8.8.8.8。作者寻求技术专家对间歇性问题原因的解释。
摘要由CSDN通过智能技术生成

# 现象

1、浏览器可以访问 gitlab 页面。一直正常。

2、在 IDEA 和 git bash 窗口中执行所有远程操作(git pull git push )都很慢,得等个好几分钟才有反应。偶尔正常不用等待。

# 排查

STEP1  在git bash 窗口中执行 GIT_TRACE=2  GIT_CURL_VERBOSE=2 git pull 可以追踪整个执行链路,发现卡在了链接服务器上, Trying 错误IP,这个IP不是我gitlab的服务地址

18:43:08.966375 exec-cmd.c:237          trace: resolved executable dir: D:/tools/Git/mingw64/bin
18:43:08.972462 git.c:460               trace: built-in: git pull
18:43:08.973967 run-command.c:655       trace: run_command: git fetch --update-head-ok
18:43:08.986495 exec-cmd.c:237          trace: resolved executable dir: D:/tools/Git/mingw64/libexec/git-core
18:43:08.992495 git.c:460               trace: built-in: git fetch --update-head-ok
18:43:08.997015 run-command.c:655       trace: run_command: GIT_DIR=.git git remote-http origin xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
18:43:09.008530 exec-cmd.c:237          trace: resolved executable dir: D:/tools/Git/mingw64/libexec/git-core
18:43:09.014040 git.c:750               trace: exec: git-remote-http origin xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
18:43:09.014040 run-command.c:655       trace: run_command: git-remote-http origin xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
18:43:09.026075 exec-cmd.c:237          trace: resolved executable dir: D:/tools/Git/mingw64/libexec/git-core
18:43:09.034585 http.c:724              == Info: Couldn't find host xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx in the (nil) file; using defaults
18:43:09.040597 http.c:724              == Info:   Trying 错误IP:80...

# 解决方式

方案1:host配置正确的IP到gitlab地址

方案2:配置网络DNS 8.8.8.8

# 原因分析

迁库地址已变。

但究其原理,为什么时而好时而不好?为什么等几分钟try fail之后后来try的IP是正确的?未知。欢迎技术大佬留言解惑。

  • 10
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值