Jenkins 无法连接到 Git 存储库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29743460/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:55:12  来源:igfitidea点击:

Jenkins can''t connect to Git repository

gitjenkinsvagrant

提问by Michael Tot Korsgaard

I'm trying to set up Jenkinsreferencing a Gitrepository. However I get this strange error

我正在尝试设置Jenkins引用Git存储库。但是我收到了这个奇怪的错误

enter image description here

在此处输入图片说明

Any idea what is wrong. The repository works fine on my team mates computers.

知道出了什么问题。该存储库在我的队友计算机上运行良好。

回答by Tim Biegeleisen

Even though your "mates" have access to the Goatic/hangmangit repository, Jenkins does not as it is running under a different user. You can add credentials from the Jenkins admin screen by doing Manage Jenkins-> Configure System

即使您的“伙伴”可以访问Goatic/hangmangit 存储库,Jenkins 也无法访问,因为它在不同的用户下运行。您可以通过执行Manage Jenkins-> Configure System从 Jenkins 管理屏幕添加凭据

enter image description here

在此处输入图片说明

Have a look at this SO postfor more information.

查看此 SO 帖子以获取更多信息。

回答by Akash Shinde

Possible assumptions for this error

此错误的可能假设



Make sure you have permission to access this repo on jenkins server machine. you can check it by putting git clone http://repo.giton cmd or terminal whatever os you are using.

确保您有权在 jenkins 服务器机器上访问此 repo。您可以通过git clone http://repo.git打开 cmd 或终端来检查您正在使用的任何操作系统。



Make sure git installed on jenkins server or not,if not then you need to install git on jenkins server first,then try adding git repo to jenkins.

确保 git 安装在 jenkins 服务器上,如果没有,则需要先在 jenkins 服务器上安装 git,然后尝试将 git repo 添加到 jenkins。



If git is installed on jenkins server machine then check PATH env variablehas proper git binary executable point location

如果 git 安装在 jenkins 服务器机器上,则检查是否PATH env variable有正确的 git 二进制可执行点位置