首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jenkins,在检索Git repo代码时生成错误。

Jenkins,在检索Git repo代码时生成错误。
EN

Stack Overflow用户
提问于 2015-07-02 14:26:21
回答 2查看 2.9K关注 0票数 1

我让Jenkins安装在Redhat Linux机器上。

我在詹金斯安装了所有的git插件。

我已经通过yum install git在服务器上安装了Git。看起来可执行文件位于/usr/bin/git中(Jenkins不会识别git.exe)。

我们有一个通过TeamForge进行的内部Git回购。(我成功地连接了一个github回购系统,只是我们公司Git遇到了一个问题)。

有人能帮我连接到内部的Git回购吗?错误日志如下所示:

代码语言:javascript
复制
Building in workspace /root/.jenkins/jobs/test/workspace
/usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
/usr/bin/git config remote.origin.url git clone ssh://b002653@teamforge.server:29418/cdn_scdn # timeout=10
Fetching upstream changes from git clone ssh://b002653@teamforge.server:29418/cdn_macys_scdn
/usr/bin/git --version # timeout=10
/usr/bin/git fetch --tags --progress git clone ssh://b002653@teamforge.server:29418/cdn_scdn +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git clone ssh://b002653@teamforge.server:29418/cdn_macys_scdn
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:735)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:983)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1016)
    at hudson.scm.SCM.checkout(SCM.java:485)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1282)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
    at hudson.model.Run.execute(Run.java:1744)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress git clone ssh://b002653@teamforge.server:29418/cdn_macys_scdn +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: I don't handle protocol 'git clone ssh'

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:733)
    ... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-07-09 13:18:20

看起来您已经将git clone ssh://b002653@teamforge.server:29418/...粘贴到您的结帐工作中,而不是ssh://b002653@teamforge.server:29418/...

票数 0
EN

Stack Overflow用户

发布于 2015-07-09 14:06:06

确保给Git可执行的提供正确的路径--在我的例子中--就像下面这样

另一个错误是,您正在提供git克隆和您的url,就像您在控制台中看到的一样,它说是fatal: I don't handle protocol 'git clone ssh'

所以你需要提供ssh://b002653@teamforge.server:29418/cdn_scdn

我希望它能胜任这项工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31187244

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档