问题情况

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

Tortoisegit上是这样说的:

git.exe push -v --progress "xx" master:master

Pushing to git@github.com:xxx/xxxx.git
ssh: connect to host github.com port 22: Bad file number
fatal: Could not read from remote repository. git did not exit cleanly (exit code 128)

gitbash上是这样说的

$ git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)

尝试解决

通过查询,发现在bash中自己没有授权key,于是按照教程,查询现有的密钥:

ls -al ~/.ssh
clip < ~/.ssh/id_rsa.pub

将现有的id_rsa加入到github网站上,并按照github的官网给的教程,将原有的id_rsa加入到本机的ssh:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

但是运行ssh -T git@github.com命令还是显示ssh: connect to host github.com port 22: Bad file number

还是没有解决,然后在官网的常见问题中看到了BadFileNumber,有三种方法,1是用https,2是关于防火墙的,看起来比较麻烦,不想弄;3就是用ssh而非https

而我现在用的好像就是https啊,于是再试着用TortoiseGit试一下,还是不行。

那就用第三种方法吧,在~/.ssh/config文件中增加,但是看看只有config file而没有Config,于是就拷贝一个重命名为config,把下面的代码粘贴:

Host github.com
Hostname ssh.github.com
Port 443

就能出现下面的成功授权提示啦~~~

The authenticity of host '[ssh.github.com]:443 ([192.30.253.123]:443)' can't be established.
RSA key fingerprint is .
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.github.com]:443,[192.30.253.123]:443' (RSA) to the list of known hosts.
Hi ! You've successfully authenticated, but GitHub does not provide shell access.

再去push看看,终于成功啦啦啦啦

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

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

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

  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. git clone遇到的[ssh: connect to host github.com port 22]

    起因 在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github. 过程 这台电脑是新电脑,所以需要先本地生成ssh key:ssh-keygen -t rsa -C ...

  4. 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: ...

  5. 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不能连接上,但是 ...

  6. 关于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 ...

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

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

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

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

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

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

随机推荐

  1. HTML5 TypeArray和Unicode 字符之间转换

    1.Uint32Array测试成功 // Uint32Array 测试成功 //字符串转为ArrayBuffer对象 function strToab() { var str = '张三丰'; var ...

  2. Initializer block.

    Ref: Initializing Fields Instance initializers are permitted to refer to the current object via the ...

  3. classpath and path.

    simply talk about the <path> and the <classpath> in java development. when the <path& ...

  4. oracle 报错 :ORA-04052、 ORA-00604、 ORA-03106、 ORA-02063

    最近发现一个很奇怪的问题: 创建了一个DB_LINK连接另一个Oracle数据库. select * from tablename@dblinkname; 单句执行没问题,但是把这句SQL写到存储过程 ...

  5. 打造属于前端的Uri解析器

    今天和大家一起讨论一下如何打造一个属于前端的url参数解析器.如果你是一个Web开发工程师,如果你了解过后端开发语言,譬如:PHP,Java等,那么你对下面的代码应该不会陌生: $kw = $_GET ...

  6. C语言求2的100次方怎么解,大整数运算

    #include "stdio.h"int ai[100]; void main(){ int a,b; ai[99]=1; for(b=0;b<100;b++)  for( ...

  7. maven mirror

    国内连接maven官方的仓库更新依赖库,网速一般很慢,收集一些国内快速的maven仓库镜像以备用. ====================国内OSChina提供的镜像,非常不错=========== ...

  8. 【ZOJ2112】【整体二分+树状数组】带修改区间第k大

    The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with t ...

  9. oc 怎么接收NSSting字符的方法

    ]; //使用一个缓冲区 NSLog(@"请输入一个字符串:"); scanf("%s",buffer); NSString * str = [NSString ...

  10. 常见ORACLE错误,及解决方案(遇则即时更新)

    1.当登陆时提示“ORA-03113:通信通道的文件结束”时:        解决方案:                     需在X:\oraclexe\app\oracle\product\10 ...