簡體   English   中英

將Jenkins配置為在Windows上使用GIT,得到stderr:權限被拒絕(公鑰)

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM