fatal:Could not read from remote repository解决方法

Linux服务器如何连接GitHub?

  1. 生成SSH密钥

ssh-keygen -C "邮箱" -t rsa

存放位置一般是/root/.ssh/id_rsa

  1. 登录个人github,添加客户端生成的公钥

打开Settings,点击SSH and GPG keys,点击New SSH Key。Key中粘贴id_rsa.pub(/root/.ssh/id_rsa.pub)公钥文件中的内容:

  1. 将key加入到ssh-agent

ssh-add ~/.ssh/id_rsa

如果在此处遇到Could not open a connection to your authentication agent,解决方法:链接: link

  1. 初始化git仓库

git init

在刚创建的仓库中测试一下SSH Key

ssh -T git@github.com

出现you're successful,即为成功。

到此Linux连接GitHub完成。接下来就可以git clone了。

参考:https://blog.csdn.net/XreqcxoKiss/article/details/109854662

相关推荐
高频因子挖掘机37 分钟前
QuantDash 成交量单位统一实战:从“手”到“股”的跨市场量化数据清洗全流程
后端·算法·github
CoderJia程序员甲1 小时前
GitHub 热榜项目 - 周榜(2026-08-22)
ai·大模型·llm·github·ai教程
丰锋ff1 小时前
Github使用教程
github
leoZ2311 小时前
10-Git 仓库蒸馏术:从代码仓库到 OpenClaw 虚拟人-蒸馏工具链
大数据·git·深度学习·神经网络·目标检测·elasticsearch·lstm
fpcc14 小时前
工具使用—git diff命令分析说明
git·工具
console.log('npc')14 小时前
Git 删除指定提交记录操作指南
git
随风丶飘15 小时前
[特殊字符] 告别“update“和“fix bug“——Smart Git Commit LLM 让 AI 帮你写专业的 Git 提交信息
人工智能·git·bug
yanlaifan15 小时前
git clone时候指定换行符
git
领创工作室17 小时前
GitHub Workflows 全面解析:从核心概念到开源实现
运维·github
小小安于乱19 小时前
解决IDEA的git插件pull代码冲突但右下角不提示消息问题
java·git·intellij-idea