报错详情
当执行 git push 时报错:
解决方案
首先,先确定是否输入正确的名称和链接,同时查看是否开启 sslVertify 以及 远程地址是否正确
// 查看全局配置 - 查找 user 相关
git config --global --list | findstr "user"
// or - 查看全部配置
git config --global --list
// 查看局部配置
git config --list
// 全局配置 user - name 和 email 可以在创建的仓库查看
git config --global user.name 'xxx'
git config --global user.email 'xxx@yyy.com'
// 局部
git config user.name 'xxx'
git config user.email 'xxx@yyy.com'
// 查看远程配置
git remote -v
// 配置远程仓库 - origin 可自定义
git remote add origin 远程地址
// 配置 sslVerify - 注意大小写
git config --global http.sslVerify true
// 推送内容到远程仓库
git push -u origin master
配置好后再次尝试推送,若继续报错:
git config --global credential.helper store
git remote set-url origin 远程仓库地址
此时再次执行,应该会弹窗让你输入秘钥(在你仓库个人页面设置的秘钥),输入后就可以。