首页 > 解决方案 > Jenkins:Git 无法连接到存储库,返回状态码 128

问题描述

我正在尝试克隆远程 GitHub 企业存储库,并在将远程存储库的 URL 添加到我的 Jenkins 配置中的 Git 插件后遇到以下错误:

Failed to connect to repository : Command "git.exe ls-remote -h https://<<server>>/M/AS.git HEAD" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://<<server>>/M/AS.git/': Received HTTP code 502 from proxy after CONNECT

标签: jenkinsgithub

解决方案


首先,您还需要在下面的部分中使用 jenkins 设置 github

转到Github --> click on profile dropdown--> settings--> devloper settings--> personal access token--> generate new token--> select all scopes-->copy the token

然后去Jenkins --> manage Jenkins--> github settings--> add user--> Select secret text-->paste the token

然后通过单击测试按钮测试 git-hub 连接如果成功,Jenkins 将准备克隆 GitHub 存储库

并且还在 GitHub 中添加 Webhook、集成和服务


推荐阅读