使用IDEA和git提交的问题解决

使用IDEA和git提交代码问题解决

问题现象,github上已经配置sshkey。本地也没问题,但推送代码时报错:

1
fatal: unable to access ' ': SSL certificate problem: unable to get local issuer certificate

我一开始以为是github上的ssh没配置,但是查看之后发现已经配置过了。又怀疑是本地ssh和github上不一致,于是查看本地ssh,打算重新添加:

1
cat ~/.ssh/id_ed25519.pub  # 如果你使用的是rsa密钥,请将id_ed25519.pub改为id_rsa.pub

复制了ssh后去github添加,结果显示这个ssh已经添加了,现在万策尽了。

后来我在csdn上查了查,看到这篇文章:[文章]([克隆github项目时,报错:fatal: unable to access ‘https://github.com/YunaiV/yudao-cloud.git/‘: SSL certificate-CSDN博客](https://blog.csdn.net/2401_82434337/article/details/136465564?ops_request_misc=%7B%22request%5Fid%22%3A%22d4df004de78f3e2fb0dd01e4e335f61e%22%2C%22scm%22%3A%2220140713.130102334.pc%5Fall.%22%7D&request_id=d4df004de78f3e2fb0dd01e4e335f61e&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-2-136465564-null-null.142^v102^pc_search_result_base4&utm_term=fatal%3A unable to access https%3A%2F%2Fgithub.com%2FMr-Labyrinth%2FCelestialWoeAndHumanRuin-template-1.20.1.git%2F%3A SSL certificate problem%3A unable to get local issuer certificate&spm=1018.2226.3001.4187))文中说这个问题时http代理问题。只需执行下面的命令就行了:

1
git config --global http.sslVerify false