起因

在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github

过程

这台电脑是新电脑,所以需要先本地生成ssh keyssh-keygen -t rsa -C "youremail@example.com"
可参考-远程仓库
第一步:ssh-keygen -t rsa -C "youremail@example.com"
第二步:在用户目录下,找到.ssh文件夹下的id_rsa.pub,打开先复制全部内容;
第三步:登录github,个人帐号setting下的SSH and GPG keys,然后点击右上角的New SSH key。之后把第二步复制的都拷贝到key输入框;
第四步:开始克隆:git clone git@github.com:***/***.git

正常会成功的,可惜报错了!

g1.png

解决

因为公司是代理上网,初步猜测应该是这个问题。

那就googlebaidu寻找解决方式。

根据报错提示,应该是ssh连不通。
网上找到ssh -T git@github.com可参考-Testing your SSH connection
测试过结果如下:

g2.png

所以,接着搜索ssh: connect to host github.com port 22: Connection timed out,发现貌似找到解决方式了。

image.png

可参考-ssh: connect to host github.com port 22: Connection timed out
这个说的就是把协议从ssh方式换成https。先别管本地git config --local -e是否可行,要尽快解决问题。
所以,git clone的时候,换个协议就好了!

git clone https://github.com/***/***.git

image.png

小结

xxx

思考

  1. 为什么ssh协议会存在问题,而https则不会?什么是ssh协议?https协议呢?两者的区别?
  2. git bash下的git clone xxx是怎么发请求的?类似于curl?还是??
  3. xxx

git clone遇到的[ssh: connect to host github.com port 22]的更多相关文章

  1. GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)

    问题情况 本来一直用的是github的客户端,结果现在上传的时候出问题了,去网站上看,新项目已经创建,但是代码却怎么都上传不上去.于是只好用命令行的方式解决. Tortoisegit上是这样说的: g ...

  2. ssh: connect to host github.com port 22: Connection timed out

    问题描述 $ git clone git@github.com:MaugerWu/MaugerWu.github.io.git Cloning into 'MaugerWu.github.io'... ...

  3. Github拉取远端的时候提示“ssh: connect to host github.com port 22: Connection timed out”错误

    在使用Github的时候,如果使用到拉取远端分支的时候或者测试ssh -T git@github.com的时候可能会出现连接失败的问题,错误描述为“ssh: connect to host githu ...

  4. 关于github报错:ssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

    当执行git命令如:git clone.git pull等等 出现报错:ssh: connect to host github.com port 22: Connection timed outfat ...

  5. ssh: connect to host github.com port 22: Connection refused

    假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...

  6. github连接报"ssh: connect to host github.com port 22: Connection timed out"错误

    1. 异常 在连接github时,执行"ssh -T git@github.com" 命令时,出现 ssh: connect to host github.com port 22: ...

  7. github默认端口22被占用,ssh: connect to host github.com port 22: Connection timed out

    出现github 连接错误: ssh:connect to host github.com port 22:Connection timed out 刚开始以为是网络问题,github不能连接上,但是 ...

  8. 关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository.

    今天上午写demo的时候,突然pull不下代码了,报了一下这样情况的错误: 看了一下代码,怀疑是网路错误,因为在这以前一切都正常的,然后将代码复制搜索了一番,解决办法有很多什么配置config啦,gi ...

  9. ssh: connect to host gihub.com port 22: Connection timed out

    方案1(本人使用此方案,问题得已解决): 可能是ssh-server未安装或者未启动.我的ubuntu 12.04 默认只安装了openssh-client,并没有安装server. 运行 ps -e ...

随机推荐

  1. VMware虚拟机安装linux7并设置网络

    1.下载VMware虚拟机 https://www.vmware.com/cn/products/workstation/workstation-evaluation.html 永久激活12位序列号: ...

  2. Accesshelper.cs

    using System; using System.Data; using System.Data.OleDb; using System.Collections; using System.IO; ...

  3. Java 进阶7 并发优化 1 并行程序的设计模式

       本章重点介绍的是基于 Java并行程序开发以及优化的方法,对于多核的 CPU,传统的串行程序已经很好的发回了 CPU性能,此时如果想进一步提高程序的性能,就应该使用多线程并行的方式挖掘 CPU的 ...

  4. CF 913 A

    题解: 首先判断n是否大于30 大于30输出m 否则输出m%2^n 代码: #include<bits/stdc++.h> using namespace std; int n,m; in ...

  5. 淘宝TDDL配置以及使用

    此章节具体介绍一下淘宝TDDL具体配置和使用 1. Spring配置文件配置:================spring-mybatis.xml 中配置============= <bean ...

  6. LeetCode OJ:Gas Station(加油站问题)

    There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You ...

  7. Jquery EasyUI Tree树形结构的Java实现(实体转换VO)

    前一阵做的OA项目,有一个是组织架构的树,因为是分开做的,我做的是Controller和页面,其他组做的Service和Dao,因为之前一直没有商量页面用什么框架做比较好,导致,Dao层取出来的数据都 ...

  8. MoreEffectiveC++Item35(基础议题)(条款1-4)

    条款1:区别指针和引用 条款2:最好使用C++转换操作符 条款3: 绝对不要以多态的方式处理数组 条款4: 避免无用的缺省构造函数 条款1:区别指针和引用 1.指针(pointer) 使用[*/-&g ...

  9. Linux系统下第三方软件安装实例

    在第三方软件安装的时候,首先要有自己的rpm安装包!然后要有可以使用的yum源(前面有关于yum源的介绍) 一.安装wps步骤如下: 1)首先进入安装包所在目录,并查看有没有要安装的软件 2)然后,对 ...

  10. NODE 开发 2-3年工作经验 掌握的相关知识

    文章 部分答案 内存