美文网首页随笔-生活工作点滴
关于在GitHub无法提交的问题

关于在GitHub无法提交的问题

作者: 罗卡恩 | 来源:发表于2019-07-08 21:42 被阅读6次

tatal: Could not read from remote repository
这个错是我改变了地理位置,然后换了个网第一次提交会这样
之后提交就转啊转提交不上去


image.png

重新生成下Key 会覆盖之前的Key

$ ssh-keygen -t rsa -C "1004019267@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
image.png
image.png

然后把你的新pub Key粘贴过来就好了 然后发现是同一个


image.png
起码这回有响应了
image.png

然后找到目录全删了
然后发现
之后要一路按回车才可以重新生成

$ ssh-keygen -t rsa -C "1004019267@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Wn/XIYsTfWwt3XUadqpzKiaI5gBoDyW/btbVGOl2v6Q 1004019267@qq.com
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|                 |
| . .    .     o +|
|. +    o    ...*=|
|oo .  . S  . o+=+|
|..o .  B +  o.=o.|
|  .o..+.. o++.o .|
|  .+o.. . =o.=   |
|  o+.    E oo    |
+----[SHA256]-----+

然后提交 有警告提示IP永久添加成功


image.png

然后全新错误 就是没权限写入呗 一开始好像就是这个


image.png
其实一查发现是连接不上 @前面是你的GIt名 后面是你报错的ID
$ ssh -o ServerAliveInterval=60 Uncorn@52.74.233.119
ssh: connect to host 52.74.233.119 port 22: Connection timed out

说是ssh阻塞了22端口 这样添加个config文件
可以再git里面输入 创建文件夹

$cd ~/.ssh/
$ touch config
image.png
Host github.com  
User git  
Hostname ssh.github.com 
PreferredAuthentications publickey  
IdentityFile ~/.ssh/id_rsa 
Port 443

然后我用命令行推上去了

$ git push
Warning: Permanently added the RSA host key for IP address '[192.30.253.122]:443' to the list of known hosts.
Everything up-to-date

相关文章

网友评论

    本文标题:关于在GitHub无法提交的问题

    本文链接:https://www.haomeiwen.com/subject/umhwhctx.html