【发布时间】:2019-03-30 06:51:26
【问题描述】:
我可以通过 Jenkins 访问公共仓库,但是当我尝试访问私有仓库时,
我得到错误: 致命:无法读取“https://github.com”的用户名:没有这样的设备或地址
我已经将 jenkins 服务器的公钥复制到 Github SSH/部署密钥,还使用 SSH 使用用户名和密码方法将私钥复制到 Jenkins,为什么会导致错误。
【问题讨论】:
我可以通过 Jenkins 访问公共仓库,但是当我尝试访问私有仓库时,
我得到错误: 致命:无法读取“https://github.com”的用户名:没有这样的设备或地址
我已经将 jenkins 服务器的公钥复制到 Github SSH/部署密钥,还使用 SSH 使用用户名和密码方法将私钥复制到 Jenkins,为什么会导致错误。
【问题讨论】:
只要您看到一个 HTTPS URL,您的所有 SSH 密钥就没有多大帮助。
为了让 Jenkins 成功使用 SSH 密钥,您必须为您的私有仓库使用 SSH URL:
git@github.com:<auser>/arepo
OP Nishad Nazar 加上in the comments:
git pull不工作。它现在可以工作了:我将git pullURL 更改为 Git pullhttps://username:password@github.com/owner/repo。
现在它可以通过 Jenkins 从 Git 中提取更改。
【讨论】: