记录使用git遇到的问题
1. 权限问题
$ ssh -T git@github.com
The authenticity of host ‘github.com (13.250.177.223)’ can’t be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,13.250.177.223’ (RSA) to the list of know
n hosts.
git@github.com: Permission denied (publickey).
一直报上面的错误,提示没有权限,一直在修改SSH密钥的问题,结果是密钥文件名的问题,原来将生成的公钥名设置为用户名,后来直接回车就可以了。
下面是连接上的显示
zhoup@DESKTOP-OK2UA42 MINGW64 ~/.ssh
$ ssh -T git@github.com
Hi xxx! You’ve successfully authenticated, but GitHub does not provide shell
access.
2.连接远程仓库出错
报错:
$ git push -u origin com
fatal: ‘origin’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
出错原因:(应该远程的名字写成了remote了)
查看前面连接的语句是否出错:$ git remote add remote git@github.com:xxx/xxxx.git
正确:$ git remote add origin git@github.com:xxx/xxxx.git