在 jenkins 中配置 git 仓库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12614771/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
configure git repository in jenkins
提问by javier
I'm trying to configure the repository: https://github.com/javpaw/game-of-life
我正在尝试配置存储库:https: //github.com/javpaw/game-of-life
into a job in jenkins using git plugin, but when I put the address of the repository: [email protected]:javpaw/game-of-life.git
使用 git 插件在 jenkins 工作,但是当我把存储库的地址:[email protected]:javpaw/game-of-life.git
Source Code Management -> git -> repository Url I got this error:
源代码管理 -> git -> 存储库 URL 我收到此错误:
Failed to connect to repository : Command "/usr/bin/git ls-remote -h [email protected]:javpaw/game-of-life.git HEAD" returned status code 128: stdout: stderr: No protocol specified No protocol specified
(ssh-askpass:18881): Gtk-WARNING **: cannot open display: :0.0 Host key verification failed. fatal: The remote end hung up unexpectedly
无法连接到存储库:命令“/usr/bin/git ls-remote -h [email protected]:javpaw/game-of-life.git HEAD”返回状态代码 128:stdout:stderr:未指定协议 未指定协议指定的
(ssh-askpass:18881): Gtk-WARNING **: 无法打开显示: :0.0 主机密钥验证失败。致命:远端意外挂断
I found this question here in github: Why Git fail to connect to local repository with Jenkins (bad config file)?
我在 github 中发现了这个问题:Why Git failed to connect to local repository with Jenkins (bad config file)?
but was not useful because I'm using Ubuntu 12.04
但没有用,因为我使用的是 Ubuntu 12.04
How can I solve this issue?
我该如何解决这个问题?
thanks.
谢谢。
回答by VonC
Try using a complete url, with https rather than ssh:
尝试使用完整的 url,使用 https 而不是 ssh:
https://github.com/javpaw/game-of-life
You can also try the read-only address:
也可以试试只读地址:
git://github.com/javpaw/game-of-life.git
But in both case, the important part is that you specify the protocol (https://
or git://
)
但在这两种情况下,重要的部分是您指定协议(https://
或git://
)