GitHub添加远程库git push -u origin master时的问题fatal: Could not read from remote repository.
2023-09-11 14:20:02 时间
添加远程库时遇到问题
被拒绝
$ git push -u origin master
The authenticity of host '[ssh.github.com]:443 ([************]:443)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[ssh.github.com]:443,[**************]:443' (RSA) to the list of known hosts.
git@ssh.github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方法:
首先,参考了这篇博客git上传代码报错ssh: connect to host github.com port 22: Connection timed out解决办法
,在ssh目录下创建了config文件。
但发现,还是不行,也许是因为别的问题?
又参考了第二篇博客,git push -u origin master 出现The authenticity of host 'github.com ’ can’t be established解决方案
,删除了原ssh文件下的id_rsa.pub后再重新创建远程连接。
参考如下:远程仓库| 廖雪峰
再次试验
$ git push -u origin master
Enumerating objects: 20, done.
Counting objects: 100% (20/20), done.
Delta compression using up to 4 threads
Compressing objects: 100% (15/15), done.
Writing objects: 100% (20/20), 1.64 KiB | 104.00 KiB/s, done.
Total 20 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), done.
To github.com:Mr007Z/learngit.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Success!
相关文章
- git上传本地项目到github,方法2
- git上传本地项目到github
- Git SSH public key authentication failed with git on Azure DevOps
- github结合TortoiseGit使用sshkey,无需输入账号和密码
- 使用账号密码来操作github? NO!
- git 出现错误 Could not resolve host: github.com 或者 gitlab.com 或者gerrit相关( 自有服务 )
- github
- 爆肝了!阿里出版的这份 Spring Security 源码手册,狂揽 GitHub 榜首
- GitHub 终端加速最佳实践
- git与Github建立连接
- 将本地文件上传到github空仓库(git实现)
- 使用Git克隆时出现错误 Failed to connect to github.com port 443 after 2076 ms: Connection refused如何解决
- 一台电脑支持2个git账号:gitlab+github
- github与git之间怎么建立连接
- 【GitHub】在Github主页显示你的个人简历
- 使用git将项目上传到github(最简单方法)
- 【Github教程】史上最全github用法:github入门到精通
- Git以及Github使用指南(英文和中文翻译版)
- git从github拉取第三方源码本地修改并推送到github备份
- git:手把手建立远程Git仓库并完成面目初始提交
- Git - could not read Username for 'https://github.com',push报错解决办法
- git向gitHub上push和pull数据.