首先呢,我已经弄好了ssh的密钥,ssh -T git@githun.com是可以的,返回:
Hi xxxxxx! You've successfully authenticated, but GitHub does not provide shell access.
但是,当我想要git push的时候,总是失败,提示是:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: xxxxxxxxxxxx
请问这是什么情况,
我执行的是
git remote add origin git@github.com:xxxxxxx/test.git
git push -u origin master
设置Git的user name和email
生成SSH密钥
添加密钥到ssh:ssh-add 文件名,需要之前输入密码.
在github上添加ssh密钥,这要添加的是“id_rsa.pub”里面的公钥。
打开https://github.com/,在设置中添加密钥