天天看點

Jenkins 部署項目出現 Failed to connect to repository : Command

Jenkins 部署項目出現 Failed to connect to repository : Command "git ls-remote XXX

表示為,Jenkins無法連接配接到你輸入的Repository URL的 Git倉庫……

Jenkins 部署項目出現 Failed to connect to repository : Command

怎麼辦呢?

試了很多方法:

1、在git倉庫裡面配置公鑰、在Jenkins任務裡配置git私鑰——此法無效

2、倏而想到,要想是要在Repository URL  加上賬号和密碼才行。

試了一下本地Clone:

Jenkins 部署項目出現 Failed to connect to repository : Command

 ——果不其然,确實是需要在git URL 上,加入賬号和密碼的。

Jenkins 部署項目出現 Failed to connect to repository : Command

 ——完美解決,不會報錯了。