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 ...
随机推荐
- Codeforces Round #428 (Div. 2)E. Mother of Dragons
http://codeforces.com/contest/839/problem/E 最大团裸题= =,用Bron–Kerbosch算法,复杂度大多博客上没有,维基上查了查大约是O(3n/3) 最大 ...
- DOM: EVENT FLOW
捕获阶段(capture phase) 捕获阶段的定义如下(w3c):The event object propagate through the target's ancestors from th ...
- 搞懂分布式技术6:Zookeeper典型应用场景及实践
搞懂分布式技术6:Zookeeper典型应用场景及实践 一.ZooKeeper典型应用场景实践 ZooKeeper是一个高可用的分布式数据管理与系统协调框架.基于对Paxos算法的实现,使该框架保证了 ...
- opencv 图片降噪
—— # -*- coding: utf-8 -* import numpy as np import cv2 cap = cv2.VideoCapture(0) while True: _ , fr ...
- nyoj20——有向无环图深搜模板
吝啬的国度 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 在一个吝啬的国度里有N个城市,这N个城市间只有N-1条路把这个N个城市连接起来.现在,Tom在第S号城市, ...
- Inventory Update
依照一个存着新进货物的二维数组,更新存着现有库存(在 arr1 中)的二维数组. 如果货物已存在则更新数量 . 如果没有对应货物则把其加入到数组中,更新最新的数量. 返回当前的库存数组,且按货物名称的 ...
- MYSQL-实现ORACLE 和SQLserver数据中- row_number() over(partition by ) 分组排序功能
网上看见了好多例子都基本上是一样的,没有过多的解释,对于一个初学MySQL来说有点难,我把部分转摘过来如下 原文:http://www.cnblogs.com/buro79xxd/archive/20 ...
- Java复习6异常处理
Java复习6.异常处理 20131005 前言: Java中的异常处理机制是非常强大的,相比C++ 来说,更加系统.但是我们开发人员没有很好的使用这一点.一些小的程序是没有什么问题的,但是对于大型项 ...
- hdu 4771 13 杭州 现场 B - Stealing Harry Potter's Precious 暴力bfs 难度:0
Description Harry Potter has some precious. For example, his invisible robe, his wand and his owl. W ...
- nfs的简单搭建与原理
nfs最大的缺点是单点,只能一对一nfs统称存储服务器,放视频图片之类的东西,所以服务器的容量很大数字都是放在数据库里边的, nfs的挂载原理 客户端怎么知道服务端的开启端口? 找rpcbind,再启 ...