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 [email protected]

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

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

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

相关推荐
Jooolin1 小时前
Git 与 GitHub 的最佳协作范式:从 Fork 到 Pull Request,打开开源贡献之门
git·github·ai编程
Jooolin1 小时前
【编程史】Git是啥?它和GitHub关系是?
linux·git·github
南囝coding2 小时前
这个 361K Star 的项目,一定要收藏!
前端·后端·github
南菠湾3 小时前
如何在 Visual Studio Code 中配置SSH、Git 和 Copilot插件
git·vscode·ssh
asom224 小时前
GitFlow 工作模式(详解)
git
南菠湾7 小时前
How to set up SSH, Git and Copilot Extensions in Visual Studio Code
git·ssh·copilot
隔壁小白7 小时前
Laravel模板Blade 用法 x-layouts.guest 和x-guest-layout 什么区别
github·laravel
创实信息9 小时前
软件开发 | 从 Azure DevOps迁移至GitHub企业版的最佳路径
ai·github·azure·devops
qianmoQ10 小时前
GitHub 趋势日报 (2025年06月12日)
github
waterHBO16 小时前
( github actions + workflow 03 ) 手动添加 token, 防止权限不够
github