• 首页
  • 分类
  • 标签
  • 友链
  • 留言
  • 关于
Git

GitHub天坑

梦里梦外 发布于 2019-09-27

与远程仓库失联了?

为什么起个标题叫天坑呢,因为隔三差五就塌个坑出来…

Ps: 昨天刚联上,没想到这二愣子…

刚才还好好的,突然说"Could not read from remote repository",这一天天的瞎整什么玩意??

但莫得办法哩,谁让人家东西这么好,还免费
失联,就再联呗

记录下免得天天查

在本地文件处打开"Git Bash",然后输入一下命令

1
2
3
4
5
git config --global user.name "Caiij404"

git config --global user.emaim "1061690773@qq.com"

ssh-keygen -t rsa -C "1061690773@qq.com"

然后出现了

1
2
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/啊伊梭喔/.ssh/id_rsa):

敲回车

1
2
3
Created directory '/c/Users/啊伊梭喔/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

再敲两次回车
然后就出现

1
2
Your identification has been saved in /c/Users/啊伊梭喔/.ssh/id_rsa.
Your public key has been saved in /c/Users/啊伊梭喔/.ssh/id_rsa.pub.

那么来到本地/C/Users/啊伊梭喔/.ssh(记得要删除本来的.ssh文件😑)
进去就有两个文件,用文本打开id_rsa.pub.
将内容复制

来到GitHub,进入settings,点击SSH and GPG keys
新建密钥NEW SSH key,title随意,将刚复制的内容粘贴在key框,Add SSH key!!

再次来到刚才的"Git Bash",输入:

1
ssh -T git@github.com

然后就出现

1
2
3
The authenticity of host 'github.com (13.229.188.59)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

输入yes


再然后

此时,就联系上远程仓库了!!!!

再上传本地文件







我在想,是不是自己老是用localhost:4000查看文章效果而导致失联的…



Ps: 也可能是网络不太行,像我一般是使用热点,有时就会说"失联",但我换上校园网就没问题🙃🙃🙃

  • #人在屋檐下,不得不低头
Newer
70岁的祖国,生日快乐啊!
Older
2019的尾巴,我得抓住!

© 2022 梦里梦外

大树胡同第37号

Powered by Hexo Theme - flex-block