IDEA上传项目到github报错:CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

今天在用IDEA上传项目到github上时,一直上传不成功,报错,

错误信息:

Failed 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
IDEA上传项目到github报错:CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
我的这个是D盘,你们到相应的安装目录下改就好了。