昨天在新建git仓库提交代码时出现权限问题:
Please make sure you have the correct access rights
and the repository exists.
其实就是ssh认证失败导致:
- 将
/c/Users/yourname/.ssh/目录下文件清除 - 重新生成
 
ssh-keygen -t rsa -C "your-git-accout" 
回车直到出现
XXX
The key's randomart image is:
+---[RSA 2048]----+
|               .=|
|                B|
|        .o    .=o|
|      .oo..  . =E|
|      ooS.. ..*=+|
|       ......o+@o|
|         ..o o=oB|
|         o. =. o=|
|        .oo..o..=|
+----[SHA256]-----+
- 获取key的内容
 
cat /Users/yourname/.ssh/id_rsa.pub
- github上提交新的sshkey即可
 










网友评论