Jenkins 配置 Git 错误解决:CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

时间:2023-03-08 20:48:29

错误信息:

Jenkins 配置 Git 错误解决:CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crtFailed to connect to repository : Command "C:/tools/Git/bin/git.exe ls-remote -h https:/XXXXX.git HEAD" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://XXXXXX.git/': error setting certificate verify locations:
  CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
  CApath: none

发生这个错误是因为我将git 的安装目录进行了移动 ,从缺省的C:/Program Files 移动到了 C:/tools目录下。

解决方案:

修改   Git\mingw64\etc\gitconfig  文件。

将文件中的  C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt   替换成   C:/tools/Git/mingw64/ssl/certs/ca-bundle.crt

保存文件就可以了,如下图:

Jenkins 配置 Git 错误解决:CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt