本地的代码通过IDEA工具push代码到慕课网的仓库时,出现Could not read from remote repository.请问如何解决?

来源:2-4 代码关联Git远程仓库

ArthurHouKing

2021-11-29

本地的代码通过IDEA工具push代码到慕课网的仓库时,出现Could not read from remote repository.请问如何解决?
D:\StarRiverWiki>git status
On branch master
Your branch is ahead of ‘origin/master’ by 1 commit.
(use “git push” to publish your local commits)

nothing to commit, working tree clean

D:\StarRiverWiki>git remote -v
origin ssh://git@git.imooc.com:80/arthurhou/StarRiverWiki.git (fetch)
origin ssh://git@git.imooc.com:80/arthurhou/StarRiverWiki.git (push)

D:\StarRiverWiki>git remote
origin

D:\StarRiverWiki>git status
On branch master
Your branch is ahead of ‘origin/master’ by 1 commit.
(use “git push” to publish your local commits)

nothing to commit, working tree clean

D:\StarRiverWiki>git push origin master
Unable to negotiate with 117.121.101.93 port 80: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.

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

写回答

2回答

weixin_慕莱坞1431086

2022-07-06

环境:Win10

方法:在.ssh文件新建一个 config 文件,无扩展名,添加以下内容

Host *
PubkeyAcceptedKeyTypes +ssh-rsa
HostKeyAlgorithms +ssh-rsa

保存后即可

1
0

甲蛙

2021-11-30

看最后几行是没权限,像课程一样,在慕课网配置下key

0
2
甲蛙
回复
ArthurHouKing
把key删了,重新按视频再做一遍,目前还没有同学反馈按视频做有问题,有可能你复制错key了,或复制不全。 另外也可以参考这篇:https://www.imooc.com/help/detail/111,和:https://www.imooc.com/help/detail/132,这是慕课网给的关于git的文档
2021-12-01
共2条回复

Spring Boot+Vue3前后端分离,实战wiki知识库系统

一课掌握前后端最火框架,更有职场竞争力

2537 学习 · 1675 问题

查看课程