![](/img/trans.png)
[英]Jenkins issue with Git [Permission denied (publickey).] on Windows
[英]Configure Jenkins to use GIT On Windows, Got stderr: Permission denied (publickey)
我的Git版本是1.8.0,对于此版本,Jenkins中的Git安装路径是C:\\ Git \\ cmd \\ git.exe(在旧版本中,它是C:\\ Git \\ cmd \\ git.cmd)。 这解决了我遇到的问题:删除工作区时出错。 在Jenkins中,Git存储库URL使用ssh协议:git@github.com:xxxxx / xxx.git,对我而言,此URL有效。 如果找不到您的密钥,则此URL将返回错误,您需要定义%HOME%,然后密钥应位于%HOME%.ssh中。 然后我开始建造。 构建它时,我得到了:
stdout: Cloning into 'C:\Jenkins\workspace\Lily'...
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:897)
at hudson.plugins.git.GitAPI.access$000(GitAPI.java:42)
我不明白为什么Jenkins可以为存储库URL找到我的密钥,但是在克隆存储库时却找不到我的密钥。
任何帮助将不胜感激。
我公司有一个代理服务器,对我来说,使用SSH协议非常困难,它可能有办法解决代理服务器和ssh-to-github的结合,但是我放弃了。 相反,我使用了https协议。 为了不提示有关Jenkins的凭据,我使用github凭据缓存来解决此问题。 在此处检查凭证缓存: http : //www.kernel.org/pub/software/scm/git/docs/git-credential-cache.html 。 现在,我的Jenkins / Git构建可在Windows中运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.