不知道是否有同学遇到如下的问题:

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo }
span.s1 { }

git clone https://github.com/istester/ido.git    #一个git仓库。

确收到如下报错:

Cloning into 'hosts'...

fatal: unable to access 'https://github.com/racaljk/hosts.git/': Failed to connect to 192.168.1.22 port 8080: Connection refused

如上,明明clone的github仓库代码,为何会收到无法链接内网的错误呢 ?

网上找了很多帖子,没啥直接的答案。

解决思路:

猜测是git的配置问题,先看看git的所有配置信息

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo }
span.s1 { }

git config --list

可以显示所有的配置信息。

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo }
span.s1 { }

[Ido-Air:gitHome idoxu$ git config --list

credential.helper=osxkeychain

color.ui=true

user.name=Ido

user.email=ido@yunlai.cn

http.proxy=http://192.168.1.22:8080/

https.proxy=http://192.168.1.22:8080/

core.excludesfile=/Users/idoxu/.gitignore_global

difftool.sourcetree.cmd=opendiff "$LOCAL" "$REMOTE"

difftool.sourcetree.path=

mergetool.sourcetree.cmd=/Applications/SourceTree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"

mergetool.sourcetree.trustexitcode=true

core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true

core.ignorecase=true

core.precomposeunicode=true

如上,确实有http://192.168.1.22:8080/的配置信息,问题定位到。

那么,如何去掉配置呢 ?

原来是设置了代理。

去掉代理即可。

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo }
span.s1 { }

git config --global --unset http.proxy

git config --global --unset https.proxy

如上,搞定,再次 git clone ,代码可正常down下来。

延伸,既然涉及到了git的代理,那么作为好奇心,以及强烈学习欲望的tester ,必须得了解下如何设置代理。

git 代理设置方法:

git config --global http.proxy http://192.168.1.22:8080/

git config --global https.proxy https://192.168.1.22:8080/

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "PingFang SC"; color: #454545 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #454545 }

如果需要用户名和密码

git config –global http.proxy http://user:password@10.167.32.133:8080

git config –global http.proxy https://user:password@10.167.32.133:8080

git clone https://github.com/istester/ido.git ,确提示“Failed to connect to 192.168.1.22 port 8080: Connection refused” 的解决办法 。的更多相关文章

  1. git时 Failed to connect to 127.0.0.1 port 1080: Connection refused

    在公司换了一台电脑之后发现git clone 和 npm install都失败,报错为 fatal: unable to access 'https://github.com/netease-im/N ...

  2. 解决git Failed to connect to 127.0.0.1 port xxxx: Connection refused

    某天,用git拉取,提交代码的时候出现了git Failed to connect to 127.0.0.1 port xxxx: Connection refused的问题, 开始百度,看了一通.都 ...

  3. git clone Failed to connect to 127.0.0.1 port 43213: Connection refused

    不知道为什么使用git clone 的时候报了上面的错误,后面发现是 127.0.0.1 port 43213的端口被代理占用了,可以这样查看: $ env|grep -i proxy 结果是: NO ...

  4. 解决GitHub push项目——Push failed: Unable to access 'https://********.git/': Failed to connect to 127.0.0.1 port 1080: Connection refused

    解决方法: 第一步:在git中设置http代理 git config --global http.proxy 第二步:在git中取消http代理 git config --global --unset ...

  5. git clone时报错“Failed to connect to 127.0.0.1 port 2453: Connection refused”如何处理?

    1. 查看git的配置 git config --global --list| grep -i proxy 如果有内容输出,那么unset配置项,如: git config --global --un ...

  6. 【git使用】Failed to connect to 127.0.0.1 port 1080: Connection refused

    查询是否使用代理:git config --global http.proxy 取消代理:git config --global --unset http.proxy

  7. Git 拉取Gitee仓库报错:“fatal: unable to access ''": Failed to connect to 127.0.0.1 port 1080: Connection refused”

    1.报错信息: 2.本地查看是否Git使用了代理 git config --global http.proxy 3.取消代理 git config --global --unset http.prox ...

  8. linux centos7 “git clone https://github.com/XXXXX” 报错解决方法

    2021-08-04 1. 问题描述 在执行以下命令时出现错误"正克隆到 'XXXXX'... fatal: unable to access 'https://github.com/lag ...

  9. Get https://192.168.2.119/v2/: dial tcp 192.168.2.119:443: getsockopt: connection refused

    Get https://192.168.2.119/v2/: dial tcp 192.168.2.119:443: getsockopt: connection refused

随机推荐

  1. 使用CSharp编写Google Protobuf插件

    什么是 Google Protocol Buffer? Google Protocol Buffer( 简称 Protobuf) 是 Google 公司内部的混合语言数据标准,目前已经正在使用的有超过 ...

  2. js日期转化(计算一周的日期)

    之前做项目的时候遇到过一个日期转化的问题,一个日期控件和近一天,近七天和近一月的的联动效果.发现自己不会,后来就百度了一下解决了这个问题. 现在抽空又写了一个时间转化的案例(计算一周的日期),因为之前 ...

  3. Hibernate学习--hibernate延迟加载原理(动态代理)

    在正式说hibernate延迟加载时,先说说一个比较奇怪的现象吧:hibernate中,在many-to-one时,如果我们设置了延迟加载,会发现我们在eclipse的调试框中查看one对应对象时,它 ...

  4. vim 字符串替换整理

    公司项目测试,要在vi编辑其中进行多路径修改,这时候用到了字符串替换的知识,在这里我自己整理了一下. 一.基本内容替换,无特殊符号 :s/old/new/  替换当前行第一个 old 为 new   ...

  5. iOS开发 - Swift使用JavaScriptCore与JS交互

    一.前言 在这个提倡敏捷开发和H5横行的年代,原生App内嵌入一些H5页面已经成为一种流行的趋势.一套H5页面就可以适配复杂的iOS和Android页面,大量节省了开发和维护时间,如果本来就有移动端网 ...

  6. office web apps 部署-搭建域控服务器

    开始第一条先说注意事项:我所配置的环境是用了三台2012server虚拟机,三台虚拟机必须要加下域控,而且登录操作的时候必须以域账号登录,否则测试不通过!在笔记本上搭建了两个虚拟机(window se ...

  7. eNSP自学入门(基础)

    写了上篇博客之后,就立即投入到了eNSP的怀抱之中了,自己从零基础,入门到现在.也学了不少东西,在这里和大家分享一下. 说一下学习的过程吧,老师说做网络工程的课程设计用eNSP,关于这个软件什么都没有 ...

  8. Spring Cloud构建微服务架构(一)服务注册与发现

    Spring Cloud简介 Spring Cloud是一个基于Spring Boot实现的云应用开发工具,它为基于JVM的云应用开发中的配置管理.服务发现.断路器.智能路由.微代理.控制总线.全局锁 ...

  9. UNIX 系统概述

    UNIX体系结构(UNIX Architecture) 调用内核的接口叫做系统调用(system call,图1.1中的阴影部分),普通函数库是建立在系统调用接口的基础之上.应用(applicatio ...

  10. MySQL索引及查询优化总结

    欢迎大家关注腾讯云技术社区-博客园官方主页,我们将持续在博客园为大家推荐技术精品文章哦~ 作者:谢庆玲 文章<MySQL查询分析>讲述了使用MySQL慢查询和explain命令来定位mys ...