我刚安装了Git,生成了SSH对,并将SSH密钥添加到了我的github帐户。毕竟,我已经在Git Shell中运行了ssh -T git@github.com
,并且收到了有关成功的消息:
Hi username! You've successfully authenticated, but Github does not provide shell access.
然后我尝试推送我的项目提交:使用git init
创建存储库,进行提交,添加远程:git remote add origin git@github.com:username/Project.git
,但是在使用git push origin master
之后,我得到了
git@github.com: Permission denied (publickey)
fatal: Could not read from remote repository
我的SSH对在C://Users/PCUser/.ssh
内部。
编辑:此外,config
中没有C://Users/PCUser/.ssh
文件,只有2个文件:username
和username.pub
。这可能是原因吗? config
中有一个MyProject/.git
文件:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = git@github.com:username/MyProject.git
fetch = +refs/heads/*:refs/remotes/origin/*