问题描述
在使用 git 拉取、提交代码的时候,会出现 git Failed to connect to 127.0.0.1 port xxxx: Connection refused 的问题。

原因:无法连接到127.0.0.1: xxx端口: 连接被拒绝。

解决方案
通过各种排查实验,总结出以下几种解决方案:

方案一
思路:查询当前是否有代理,如果有就取消。

// 首先,查一下当前全局的 http 代理:
git config --global http.proxy
// 如果有代理,就取消
git config --global --unset http.proxy

// 再查 https 的代理:
git config --global https.proxy
// 同样的,有就取消
git config --global --unset https.proxy
1
2
3
4
5
6
7
8
9
10
方案二
上面的方案如果不行的话,再参考这个方案

// 首先,查一下代理:
env|grep -i proxy
// 有就取消
unset http_proxy
unset https_proxy

// 再查
env|grep -i proxy
// 正常情况下是没有代理了
// 再次查询一下,如果还有的再取消

方案三
修改环境变量

在系统变量中找到了变量 http_proxy 和 https_proxy,用户变量也可以看看有没有,删除他就可以了。

重启计算机。

再用 git,正常了,再查 env|grep -i proxy ,代理没有了。

代理没有了,就可以正常拉取、提交代码了。

git Failed to connect to 127.0.0.1 port xxxx: Connection refused 的问题。的更多相关文章

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

    不知道是否有同学遇到如下的问题: p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo } span.s1 { } git clone ...

  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. 解决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 ...

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

  5. 解决 git push Failed to connect to 127.0.0.1 port 45463: 拒绝连接

    使用Github pull 代码突然报错: Failed to connect to 127.0.0.1 port 43421: Connection refused 使用 lsof 发现端口未被占用 ...

  6. 【MongoDB】 Failed to connect to 127.0.0.1:27017, reason: Connection refused

    由于项目需要,在一台虚拟机上安装了MongoDB,但是在启动的时候,出现如下错误: [root@localhost bin]# ./mongo MongoDB shell version v3.4.0 ...

  7. 解决fatal: unable to access '': Failed to connect to 127.0.0.1 port 1181: Connection refused的问题

    今天把项目提交的git远程的时候遇到一个问题 fatal: unable to access '': Failed to connect to 127.0.0.1 port 1181: Connect ...

  8. MongoDB 由于目标计算机积极拒绝,无法连接 2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061

    转载自:http://www.cnblogs.com/xiaoit/p/3867573.html 1:启动MongoDB 2014-07-25T11:00:48.634+0800 warning: F ...

  9. 【MongoDB】2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061 由于目标计算机积极拒绝,无法连接。

    1:启动MongoDB 2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errn ...

  10. Failed to connect to 127.0.0.1 port 1080: Connection refused package 问题解决方法

    错误: fatal: unable to access 'https://github.com/******': Failed to connect to 127.0.0.1 port 1080: C ...

随机推荐

  1. Windows11右键菜单修改为Win10模式的方法

    Windows11右键菜单修改为Win10模式的方法 自述: 更新win11后看着鼠标右键的菜单有些不太舒服,索性就改回了win10的右键菜单的样式 , 下面开始进行操作 第一步 首先以管理员方式打开 ...

  2. 如何在.net6webapi中记录每次接口请求的日志

    为什么在软件设计中一定要有日志系统? 在软件设计中日志模块是必不可少的一部分,可以帮助开发人员更好的了解程序的运行情况,提高软件的可靠性,安全性和性能,日志通常能帮我们解决如下问题: 调试和故障排查: ...

  3. Pychrm自定义代码块

    Pycharm -> Perferences (command + ,)

  4. 近期uniapp使用与总结

    弟弟是个uniapp小白,有什么问题欢迎指正. 吃什么饭对于有选择困难的我来说是个大问题,所以想做个根据自己输入的食物随机分配每餐吃的东西,然后就准备用uniapp做这样一个软件,主要是uniapp打 ...

  5. adb如何做Android ui自动化(这一篇就够了)

    一.简介 我们都知道在做Android ui自动化的时候用的是appium,环境搭建贼难受.如果我们在工作中遇到需要实现简单的自动化功能,可以直接使用adb来完成,无需去搭建繁琐的appium.ADB ...

  6. TrustZone——(一)

    本文内容主要来源于网络,综合了网上的多篇文章,也加入了一些自己的理解,重新组织了文章结构使其便于理解. 主要参考的文章包括: 一篇了解TrustZone TrustZone领域先行者 TrustZon ...

  7. linux cp command

    参考:http://c.biancheng.net/view/746.html [root@localhost ~]# cp [选项] 源文件 目标文件 -a:相当于 -d.-p.-r 选项的集合,这 ...

  8. Kafka主从模式和故障切换

    Kafka集群有主从模式吗? Kafka集群实际上并没有严格意义上的主从模式.Kafka的设计是基于分布式的,每个Topic都会切分为多个Partition,每个Partition都有一个Leader ...

  9. openlayers学习笔记

    https://www.cnblogs.com/suRimn/p/10649816.html

  10. 青少年CTF平台-Web-PingME

    题目描述 题目难度一颗星,五十分. 解题记录 进入题目中,发现这是一个ping功能 我们用连字符||进行分割两个语句,保证同时运行且输出. Payload为127.0.0.1 || ls 发现有fla ...