无法使用git-client插件

时间:2015-10-05 11:08:25

标签: windows git jenkins git-submodules

我试图让Jenkins检索存储库的子模块,但我无法让它工作。我在互联网上寻找解决方案,但大多数问题都围绕着身份验证,在这种情况下不是问题。根据我从错误消息中收集到的内容,该问题似乎与git-client插件处理命令行工具响应的方式有关。

因为我们已经安装了Git for Windows 2.6.0版并且Jenkins Git-client插件正式使用了#39;支持2.5.0版本,我也尝试卸载版本2.6.0并安装了2.5.0版本,但没有区别。

这里有没有人有这方面的经验或可能的解决方案? 错误是:

FATAL: Command "c:\Program Files\Git\bin\git.exe submodule update" returned status code 1:
stdout: 
stderr: Cloning into 'mysubmodule'...
error: cannot spawn echo : No such file or directory
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'http://somerepo': No error
Clone of 'http://somerepo/scm/bf/mysubmodule.git' into submodule path 'mysubmodule' failed

1 个答案:

答案 0 :(得分:1)

我遇到了同样的错误,使用相同版本的Git和Jenkins Git-client插件。 看起来这可能是一个错误和主存储库的.gitmodules文件中子模块配置错误的组合。并且错误消息绝对没有那么有用!

在我的情况下,主存储库中的.gitmodules文件包含子模块的绝对url路径。这导致Jenkins无法正确验证子模块。将子模块路径更改为相对路径(../mysub.git)为我修复了它。

这对我帮助很大: https://issues.jenkins-ci.org/browse/JENKINS-31244

我希望你觉得这很有用。