git - 无法连接到存储库 : Error performing command: git. exe ls-remote -h https ://github. com/szabbas/Sample-programs.git HEAD

标签 git bash jenkins

enter image description here我是编程新手,正在尝试使用 GIT 存储库,但在使用 JENKINS 进行配置时遇到错误。我知道这是一个愚蠢的问题,但从初学者的角度来看,我被困住了,无法前进。请帮助我解决错误。

我在 GIT 存储库中有我的代码,并尝试使用 jenkins 进行构建。但它给出的错误是: 无法连接到存储库:执行命令时出错:git.exe ls-remote -h https://github.com/szabbas/Sample-programs.git

我已经完成了通过 GID bash 进行克隆的工作,而且它的克隆与 URl 没有任何问题。我也在看enter image description here图像相同。

最佳答案

由于问题中提到的错误和新来者,很晚才到达这里,现在您应该在以下位置验证您的 git 路径:

Jenkins > Manage Jenkins > Global Tool Configuration > Git

在我的例子中,它在 PATH 环境变量中没有 git binary 的路径,所以我添加了:C:\Program Files\Git\bin

关于git - 无法连接到存储库 : Error performing command: git. exe ls-remote -h https ://github. com/szabbas/Sample-programs.git HEAD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35863528/

相关文章:

jenkins - 如何将文件从工作区外的目录复制到 Jenkins 管道中的工作区

git - 巡航控制.NET : how to set username and password for git repository task?

推送时Git错误400

Git - 跟踪分支信息

bash - 如何将此处文档的输出重定向到文本文件?

email - 如何在 Jenkins 中定义作业通知插件的电子邮件列表

git - 使用 NetBeans pull 时如何获取修改后的文件?

linux - shell 脚本中 top 命令的 CPU 信息

bash - 使用 jq 将 json 映射转换为 csv

html - 如何在 Jenkins/JUNIT xml 中的 <system-out> 或 <failure> 标签中添加 href 链接