美文网首页
git-error:the correct access rig

git-error:the correct access rig

作者: 琉璃_xin | 来源:发表于2019-04-18 09:42 被阅读0次

昨天在新建git仓库提交代码时出现权限问题:

Please make sure you have the correct access rights
and the repository exists.

其实就是ssh认证失败导致:

  1. /c/Users/yourname/.ssh/ 目录下文件清除
  2. 重新生成
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]-----+
  1. 获取key的内容
cat /Users/yourname/.ssh/id_rsa.pub
  1. github上提交新的sshkey即可

相关文章

网友评论

      本文标题:git-error:the correct access rig

      本文链接:https://www.haomeiwen.com/subject/sztzwqtx.html