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 ...
随机推荐
- jsp获取绝对路径
在JavaWeb开发中,常使用绝对路径的方式引入javaScript和CSS文件,这样可以避免因为目录变动导致引入文件找不到的情况,常用的做法是: 一.使用${pageContext.request. ...
- Ansible 小手册系列 七(Ad-hoc)
Ansible提供两种方式去完成任务,一是 ad-hoc 命令,一是写 Ansible playbook.前者可以解决一些简单的任务, 后者解决较复杂的任务. ad hoc——临时的,在ansible ...
- 获取代理服务器ip列表的方法
开源项目:https://github.com/SpiderClub/haipproxy,看爬代理的网址列表应该是最多的. CRAWLER_TASKS = [ { 'name': 'mogumiao. ...
- js中页面加载完成后执行的几种方式及执行顺序
1:使用jQuery的$(function){}; 2:使用jquery的$(document).ready(function(){});前两者本质上没有区别,第1种是第2种的简写方式.两个是docu ...
- 使用Python自带的库和正则表达式爬取熊猫直播主播观看人气
主要是体现代码的规范性 from urllib import request import re class Spider(): url = 'https://www.panda.tv/cate/lo ...
- window.history.go(-1);
history是你浏览过的网页的url(简单的说就是网址)的集合,也就是你的浏览器里的那个历史记录.它在js里是一个内置对象,就跟document一样,它有自己的方法,go就是其中一个. 这个方法的参 ...
- 【2018 “百度之星”程序设计大赛 - 初赛(B)- 1001】degree
Problem Description 度度熊最近似乎在研究图论.给定一个有 N 个点 (vertex) 以及 M 条边 (edge) 的无向简单图 (undirected simple graph) ...
- (MSSQL)sp_refreshview刷新视图失败及更新Table字段失败的问题解决
在近期工作中遇到一个任务,需要批量更改散布在很多Table中的某字段,同时刷新相关视图,但是在执行脚本时,发现了如下问题 更新字段问题 消息 ,级别 ,状态 ,第 行 对象'View_Simple' ...
- log4cpp总结
body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...
- 过滤器(Filter)
1 什么是过滤器 过滤器JavaWeb三大组件之一,它与Servlet很相似!不它过滤器是用来拦截请求的,而不是处理请求的. 当用户请求某个Servlet时,会先执行部署在这个请求上的Filter,如 ...