【发布时间】:2015-06-18 09:10:50
【问题描述】:
我们在 Windows Server 2012 上安装 Jenkins 时遇到了缓慢的 git fetch 命令。我已经尝试了这些线程中提到的所有解决方案:
Hudson git commands are *incredibly* slow(使用 PuTTY 中的 plink.exe 并设置 GIT_SSH 以使用它)
Jenkins hanging at "Fetching upstream changes from origin"(将 Jenkins 更改为使用 cmd\git.exe 而不是 bin\git.exe)
任何人都能够通过永久修复找到解决方案?
Jenkins 的控制台输出日志:
由远程主机启动
在工作区 F:\Jenkins\jobs\xxx\workspace 的 master 上构建
> git.exe rev-parse --is-inside-work-tree # timeout=10
从远程 Git 存储库获取更改
> git.exe 配置 remote.origin.url xhttp://scm/git/xxx # timeout=10
从 xhttp://scm/git/xxx 获取上游变化
> git.exe --version # timeout=10
使用 .gitcredentials 设置凭据
> git.exe config --local credential.helper store --file=\"C:\Users\APP_JE~1\AppData\Local\Temp\git7476037793811743133.credentials\" # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress xhttp://scm/git/xxx +refs/heads/:refs/remotes/origin/
这里的问题:上述命令可能需要 30 秒到 120 秒。在本地开发机器上,这需要几秒钟。
> git.exe config --local --remove-section credential # timeout=10
版本信息:
Jenkins:1.608(最新)
Windows:服务器 2012
Git:1.9.5(Windows xhttp://git-scm.com/download/win 的最新版本)
Jenkins 的 Git 客户端插件:1.16.1(最新)
Jenkins 的 Git 插件:2.3.5(最新)
Jenkins 以在服务器上具有管理员访问权限的域用户身份运行
【问题讨论】:
-
您是否尝试按照 [此处][1] 所述重新安装 git? [1]:stackoverflow.com/a/4506192/779338
-
是的,我试过了。它没有帮助。我还应用了这 3 个配置选项,但没有运气:
$ git config --global core.preloadindex true$ git config --global core.fscache true$ git config --global gc.auto 256 -
您的服务器是否在与本地计算机不同的代理后面?我们的代理扫描所有文件有时会出现问题,这需要一些时间。
-
@michaelbahr 不,不是。使用 git Bash 从服务器手动运行命令没有问题。这是 git 和 Jenkins 结合的问题。
-
这个 Thomas 有什么更新吗?我们在这里看到了同样的事情。
标签: git ssh jenkins jenkins-plugins git-fetch