赞
踩
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是正确的?未知。欢迎技术大佬留言解惑。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。