git clone遇到的[ssh: connect to host github.com port 22]
起因
在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github。
过程
这台电脑是新电脑,所以需要先本地生成ssh key:ssh-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。
正常会成功的,可惜报错了!
解决
因为公司是代理上网,初步猜测应该是这个问题。
那就google或baidu寻找解决方式。
根据报错提示,应该是ssh连不通。
网上找到ssh -T git@github.com,可参考-Testing your SSH connection。
测试过结果如下:
所以,接着搜索ssh: connect to host github.com port 22: Connection timed out,发现貌似找到解决方式了。
可参考-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
小结
xxx
思考
- 为什么
ssh协议会存在问题,而https则不会?什么是ssh协议?https协议呢?两者的区别? git bash下的git clone xxx是怎么发请求的?类似于curl?还是??- xxx
git clone遇到的[ssh: connect to host github.com port 22]的更多相关文章
- GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)
问题情况 本来一直用的是github的客户端,结果现在上传的时候出问题了,去网站上看,新项目已经创建,但是代码却怎么都上传不上去.于是只好用命令行的方式解决. Tortoisegit上是这样说的: g ...
- 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'... ...
- Github拉取远端的时候提示“ssh: connect to host github.com port 22: Connection timed out”错误
在使用Github的时候,如果使用到拉取远端分支的时候或者测试ssh -T git@github.com的时候可能会出现连接失败的问题,错误描述为“ssh: connect to host githu ...
- 关于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 ...
- ssh: connect to host github.com port 22: Connection refused
假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...
- 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: ...
- 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不能连接上,但是 ...
- 关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository.
今天上午写demo的时候,突然pull不下代码了,报了一下这样情况的错误: 看了一下代码,怀疑是网路错误,因为在这以前一切都正常的,然后将代码复制搜索了一番,解决办法有很多什么配置config啦,gi ...
- ssh: connect to host gihub.com port 22: Connection timed out
方案1(本人使用此方案,问题得已解决): 可能是ssh-server未安装或者未启动.我的ubuntu 12.04 默认只安装了openssh-client,并没有安装server. 运行 ps -e ...
随机推荐
- 51NOD-1960-数学/贪心
1960 范德蒙矩阵 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注 LYK最近在研究范德蒙矩阵与矩阵乘法,一个范德蒙矩阵的形式如下: 它想通过构 ...
- iOS开发图片加载的内存问题及优化方案
原创作者:Magic-Unique 原文地址:https://github.com/Magic-Unique/HXImage猿吧 - 资源共享论坛: http://www.coderbar.cn 做最 ...
- laravel怎么获取到public路径
app_path() app_path函数返回app目录的绝对路径: $path = app_path(); 你还可以使用app_path函数为相对于app目录的给定文件生成绝对路径: $path = ...
- poj1273&&hdu1532
题解: 双倍经验 dinic模板题 然后ff过不了... 代码: #include<cstdio> #include<cstring> #include<algorith ...
- nfc功能读写 demo
点此下载//这个demo是把这个程序作为一个手机启动选择的,只要一扫到卡片就会跳转到这个Activity. 只在当前Activity中有效参考:http://blog.csdn.net/zoeice/ ...
- Django-自定义分页组件
1.封装的分页代码: class PageInfo(object): def __init__(self,current_page,all_count,per_page,base_url,show_p ...
- Corosync+pacemaker实现集群的高可用
一.Corosync和pacemaker的了解: Corosync是集群管理套件的一部分,他在传递信息的时候可以通过一个简单的配置文件来定义信息传递的方式和协议等.也就是说,corosync是Mess ...
- PostgreSQL时间格式及相关函数实践
在创建表的时候,有客户需要将时间转为字符串,而且要求了具体的格式,如:20181115101010001.方便记录数据的更新时间,貌似是给Mysql使用,当时就很蛋疼,时间格式存储子啊数据库中就是va ...
- Amazon面试题
亚马逊面试题: 如下所示的Map中,0代表海水,1代表岛屿,其中每一个岛屿与其八领域的区间的小岛能相连组成岛屿群.写代码,统计Map中岛屿个数. /* Q1. Map [ 0 0 0 0 0 0 0 ...
- [Linux] 虚拟环境的配置和使用 virtualenv
1.安装 sudo apt-get install python-virtualenv 2.使用 创建虚拟环境: virtualenv [虚拟环境名称] 例如: virtualenv env_test ...