关于Please make sure you have the correct access rights and the repository exists.问题的解决方式

输入:git push -u origin master命令出现以下类似内容

Theauthenticity of host 'github.com (13.250.167.23)' can't be established.

RSAkey fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.

Areyou sure you want to continue connecting (yes/no)? no

Hostkey verification failed.

fatal:Could not read from remote repository.

 

Pleasemake sure you have the correct access rights

andthe repository exists.

解决:

git config –globaluser.email“your@email.com”回车获取your@email.com

 

$ ssh-keygen -t rsa -C "your@email.com"

会出现

Generatingpublic/private rsa key pair.

Enterfile in which to save the key (/c/Users/mashuai/.ssh/id_rsa):

无视这些请继续直接按下回车

Enterpassphrase (empty for no passphrase):

Entersame passphrase again:

Youridentification has been saved in /c/Users/mashuai/.ssh/id_rsa.

Your public key has been saved in /c/Users/mashuai/.ssh/id_rsa.pub.

Thekey fingerprint is:

SHA256:PwMOjau2FfUgxY9u5r1UQ/WpzNkgxxtPazsaFdztukM“1072815616@qq.com

Thekey's randomart image is:

+---[RSA2048]----+

|       ..    .  |

|       ..  ....+|

|      . oo ..= =+|

|       =.o..= X.o|

|      +.S . o* *.|

|       =+o . .E..|

|      o+..= o.o |

|    .o ...o  +..|

|   .o.   .. ... |

+----[SHA256]-----+

之后打开提示的目录下(红色提示)用记事本打开id_rsa.pub,进入到自己的账号https://github.com/....../settings/keys/new,复制记事本内容到Key,无视Title即可

之后执行命令: git push-u origin master

 

仍出现如下:

ERROR:The key you are authenticating with has been marked as read only.

fatal:Could not read from remote repository.

 

Pleasemake sure you have the correct access rights

andthe repository exists.

解决:输入命令git pull--rebase origin master从远程分支进行拉取

会出现以下类似内容说明拉取成功

Warning:Permanently added the RSA host key for IP address '13.229.188.59' to th                                                                                                               elist of known hosts.

warning:no common commits

remote:Counting objects: 3, done.

remote:Total 3 (delta 0), reused 0 (delta 0), pack-reused 0

Unpackingobjects: 100% (3/3), done.

Fromgithub.com:maerqi/hello-world

 * branch            master     -> FETCH_HEAD

 * [new branch]      master    -> origin/master

First,rewinding head to replay your work on top of it...

最后在执行命令: git push-u origin master,出现类似以下内容

Countingobjects: 16, done.

Deltacompression using up to 4 threads.

Compressingobjects: 100% (15/15), done.

Writingobjects: 100% (16/16), 1.43 KiB | 489.00 KiB/s, done.

Total16 (delta 4), reused 0 (delta 0)

remote:Resolving deltas: 100% (4/4), done.

Togithub.com:maerqi/hello-world.git

   da99626..ae02fd0  master -> master

Branch'master' set up to track remote branch 'master' from 'origin'.

说明已成功和远程仓库完美连接,该做什么事了你心里还不清楚吗

 

参考

 https://blog.csdn.net/qq_34291777/article/details/55052201?locationNum=1&fps=1

https://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值