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

相关推荐
怕浪猫15 小时前
GEO 优化到底是什么?AI时代内容创作者必须懂的新技能
算法·面试·github
miofly16 小时前
Aleph Alpha 开源 78B 参数 MoE 模型 Kolibri
开源·github
JackSparrow41417 小时前
和AI一起将全部CSDN博文迁移到个人博客站
人工智能·程序人生·ai·github·cloudflare·astro·静态博客
CoderJia程序员甲1 天前
GitHub 热榜项目 - 周榜(2026-10-03)
ai·大模型·llm·github·ai教程
miofly1 天前
GitHub 今日推荐|lipflow:无麦克风唇读文字输入工具
python·开源·github
寺中人1 天前
Xshell 完全入门指南:从安装到实战,远程连接+文件传输+会话管理全拆解
git·ssh·github·php·远程连接·xshell·运维工具
酬谢神明则必安1 天前
git学习记录01
linux·git·学习
lingchen19061 天前
版本控制 Git源代码项目管理
git
虫无涯1 天前
Coverity 如何结合 GJB8114-2013使用?
git·单元测试·嵌入式测试·coverity·静态扫描
蜗牛互联网1 天前
从GitHub动态工作流理解确定性编排与Agent判断边界
java·人工智能·后端·github