解决方法:把https模式换成ssh模式
第一步:用git remote -v查看使用的是https还是ssh。
git remote -v
第二步:使用git remote set-url命令将远程URL从HTTPS更改为SSH
git remote set-url origin git@github.com:xxxx/xxxxx.git
参考链接:fatal: unable to access 'https://gitee.com/...': Could not resolve host: gitee.com - youlj - 博客园