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

猜你喜欢

转载自blog.csdn.net/summertime1234/article/details/133811924
今日推荐