问题描述
Jenkins版本:1.429
Git插件版本:1.1.12
我无法获得Git插件克隆一个Git仓库。它会失败并显示错误消息
命令git clone --progress -o vipor V:\VIPOR c:\ Program Files \jenkins\workspace 返回状态码128:克隆到
c:\程序文件\jenkins\\\workspace ...
致命:'V:\VIPOR'似乎不是git存储库
致命:远端意外挂断
被克隆的Git repo位于本地网络中。我已经尝试了以下内容:
- 阅读Git插件文档,特别是关于状态代码的部分
- 翻转斜杠使用UNIX风格的路径
- 访问源存储库作为UNC路径(而不是名为
V
的映射驱动器) > - 强制Jenkins使用不含空格的路径(编辑
config.xml
) - 确保git可执行文件位于PATH中
- 强制Windows Jenkins服务不在系统帐户下运行,而是作为我
我试过的最后一个是因为我成功地通过执行非常命令来发布Git插件, Jenkins server 和具有相同的Git可执行文件。
我缺少什么?
对于一个网络路径(比如V :)来说是可访问的/活性,用户需要登录。即使您以您的身份运行服务,Jenkins服务也不会实际登录到系统,因此网络路径通常不会由驱动器号提供。
您可能想尝试存储库的实际路径,例如:
\\\ \\ server \path\to\gitrepo
并查看是否有效。
Jenkins version: 1.429
Git plugin version: 1.1.12
I am unable to get the Git plugin to clone a Git repository. It fails with the error
Command "git clone --progress -o vipor V:\VIPOR c:\Program Files\jenkins\workspace" returned status code 128: Cloning into c:\Program Files\jenkins\workspace... fatal: 'V:\VIPOR' does not appear to be a git repository fatal: The remote end hung up unexpectedly
The Git repo being cloned is on the local network. I have already tried the following
- Read the Git plugin docs especially the part about the status code
- Flipped the slashes to use UNIX-style paths
- Accessed the source repository as a UNC path (instead of the mapped drive named
V
) - Forced Jenkins to use a path without spaces (editing the
config.xml
) - Ensured that the git executable is on the PATH
- Forced the Windows Jenkins service to run not under a system account but as me
The last one I tried because I am successfully able to clone the repository in question by executing the very command being issued Git plugin, on the Jenkins server and with the same Git executable.
What am I missing?
I believe the problem is this:
For a network path (such as V:) to be accessible/active, a user needs to be logged in. The Jenkins service does not actually log-in to a system, even if you run the service as you, and therefore network paths are usually not available by drive letter.
You might want to try the actual path to the repository, such as:
\\server\path\to\gitrepo
and see if that works.
这篇关于无法让詹金斯和Git玩得很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!