环境:Win10;Git
已解决:
1.到C:\Users\admin(用户)目录下没有找到.ssh文件
重新配置Git的Name和Email,再去目录下查看
git config --global user.name 用户名
git config --global user.email 邮箱
2.执行push:
git push -u origin master
提示显示:
Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
到目录下只看到了known_hosts文件
ssh-keygen
命名为原名就好,文件路径是当前打开git bash的路径
然后将id_rsa和id_rsa.pub复制到.ssh目录下,打开id_rsa.pub文件,将公钥内所有内容复制,打开GitHub的Settings,到SSH AND GPG keys新增一个SSH key,再次push,解决
我报这个错的原因应该是之前使用Git配置了另一个不属于GitHub的仓库的原因