我们使用 jenkins 构建项目已有两年多了。我们最近更新了 jenkins 和插件(我们需要 maven-3 功能),现在它无法执行简单的 git fetch。这是错误消息:
FATAL: Failed to fetch from https://github.com/powertac/sample-broker.git hudson.plugins.git.GitException: Failed to fetch from https://github.com/powertac/sample-broker.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:625) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:847) ... Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/powertac/sample-broker.git +refs/heads/*:refs/remotes/origin/*" returned status code 129: stdout: stderr: error: unknown option `progress' usage: git fetch [options] [ ..]
正如你所看到的,jenkins发出的命令行包含一个未知选项--progress。我已经搜索了配置文件,但找不到它来自哪里。以下是相关版本号:
Jenkins :1.550
JenkinsGit插件:2.0.1
git: 1.7.0.4
操作系统:Ubuntu 10.04
我错过了什么?
最佳答案
不幸的是,它被硬编码在 Git Client Plugin 中,这是 Git Plugin 的依赖项.
fetch 命令的Git --progress
选项 become available在版本 1.7.1 中。
Git 客户端插件 started using自版本 1.5.0 起,git fetch 命令的 --progress
选项。
在此之前,在 1.4.6 版本中,Git 客户端插件使用 git clone 命令而不是 fetch,并且 made a check在决定是否使用 --progress
选项之前先检查已安装的 git 版本(自 git 版本 1.7.0 起,become available 用于 git clone 命令)。
解决您的问题的可能方法(从最简单的方法开始)是:
- 在您的系统上获取较新的(1.7.1+)版本的 git;在 Ubuntu 上获取最新版本的软件可能会成为一个问题,因此您可能需要检查 this thread
- 要求 Git 客户端插件团队添加对 git 1.7.0 的支持,等到他们发布新版本后再使用
- 安装旧版本(1.4.6)的 Git 客户端插件;请注意,您可能还需要降级 Git 插件以保持兼容性
- 在本地修补 Git 客户端插件
- ...想出一些更痛苦的事情:)
关于git - Jenkins git fetch 因未知选项 --progress 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21735978/