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

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

表示为,Jenkins无法连接到你输入的Repository URL的 Git仓库……

 

 

怎么办呢?

试了很多方法:

1、在git仓库里面配置公钥、在Jenkins任务里配置git私钥——此法无效

(reference: https://blog.csdn.net/huqiankunlol/article/details/93485719

 

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

试了一下本地Clone:

   

 ——果不其然,确实是需要在git URL 上,加入账号和密码的。

    

 

 ——完美解决,不会报错了。

 

posted on 2021-02-07 20:57  CuriousZero  阅读(8305)  评论(0编辑  收藏  举报

导航