如下图所示,当我试图克隆别人的repo时,会发生这样的错误,当我从git:/而不是https://,克隆时,它工作得很好。

发生这种情况是因为代理是在git中配置的。既然它是https代理(而不是http)git config http.proxy和git config --global http.proxy也无济于事。

解决方案一

1、看看你的git配置

git config --global -l

如果你没有任何与https代理相关的内容,例如https_proxy = ...问题不在这里。

如果您有与https代理相关的内容,请将其从〜/ .gitconfig文件中删除,然后重试。

2、如果仍然不起作用,请取消设置环境变量

env|grep -i proxy

你应该有一行或几行https_proxy = ...

使用以下内容逐个取消设置:取消设置https_proxy(或HTTPS_PROXY,具体取决于变量的名称)

3、再次检查环境变量

env|grep -i proxy

如果它没有显示任何你应该是好的。

注意:此解决方案可以应用于http和https代理问题。只是变量名称从https更改为http。

解决方案二

在开启shadowsocks的前提下,手动配置git的代理。git客户端输入如下两个命令就可以了。

git config --global http.proxy http://127.0.0.1:1080

git config --global https.proxy http://127.0.0.1:1080

http://也可以改成sockets5://,但是区别在于:socks5不支持通过pubkey免密登录github,每次提交代码只能输入用户名和密码。http可以支持免密登录。

取消代理:

git config --global --unset http.proxy 

git config --global --unset https.proxy 

其实方案一和方案二是同一种方法,不过方案二更加具体一点罢了,大部分问题都可以用方案二解决,当方案二无效时,考虑使用方案一。

参考文献:https://stackoverflow.com/questions/24543372/git-cannot-clone-or-push-failed-to-connect-connection-refused

git clone出现 fatal: unable to access 'https://github.com/...'的解决办法(亲测有效)相关推荐

  1. git clone出现 fatal: unable to access ‘https://github.com/...‘的解决办法(亲测有效)

    windows系统检测下Users/下的.git-credentials文件中的账号密码是否与真实密码一致,不一致修改成正确的

  2. git clone出现 fatal: unable to access ‘https://github.com/...‘的解决办法

    发生这种情况是因为代理是在git中配置的.既然它是https代理(而不是http)git config http.proxy和git config --global http.proxy也无济于事. ...

  3. git clone 出现fatal: unable to access ‘https://github 类错误解决方法

    git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxx ...

  4. git clone 出现fatal: unable to access https://github 解决方法

    git clone 出现fatal: unable to access https://github 类错误解决方法 git clone 遇到问题: ① fatal: unable to access ...

  5. git clone 出现fatal: unable to access ‘https://github.com/xxx: Failed to connect to github.com

    问题描述: 使用git clone命令时,出现如下错误: fatal: unable to access 'https://github.com/xxx': Failed to connect to ...

  6. git clone出现 fatal: unable to access ‘https://github.com/...‘的两种解决方法

    利用gitee下载github中开放的源码 方法一:             step 1:             step 2:             step 3: 方法二           ...

  7. git clone出现 fatal: unable to access ‘https://github.com/...

    发生这种情况是因为代理是在git中配置的.既然它是https代理(而不是http)git config http.proxy和git config --global http.proxy也无济于事. ...

  8. git clone出现 fatal: unable to access ‘https://github.com/...‘resolve host: ds-git.gree.com的解决办法

    我出现这个问题,是因为网不好. 可参考: 添加链接描述 或者 添加链接描述

  9. git clone报错 unable to access “https://github.com/xxxxx“

    在克隆github其他人代码时,发现报错:fatal: unable to access 'https://github.com/xxxxx/': Failed to connect to githu ...

最新文章

  1. lucene-solr本地调试方法
  2. weblogic自带的jdk是在工程的包部署后编译使用
  3. conscience ['kɔnʃəns]
  4. positional encoding位置编码详解:绝对位置与相对位置编码对比
  5. 什么是MARC数据?
  6. 360浏览器打不开qq空间_刘连康:解决电脑网络正常,浏览器打不开的问题
  7. 百搭手绘卡通牛年吉祥生肖素材,萌到心里的小牛
  8. 中国象棋将帅问题java_编程之美读书笔记1.2——中国象棋将帅问题
  9. 基于《知网》的词汇语义相似度计算以及复现
  10. [4G+5G专题-143]: 一体化小基站-硬件架构设计概述
  11. 20220522Python3.10安装教程
  12. rufus下载包,exsi自启动制作工具
  13. 云计算如何从计算机发展而来,云计算是由什么发展而成的产物?
  14. mac电脑投屏到小米盒子_苹果手机,小米盒子投屏,连接不上,什么情况?
  15. Keil C语言 宏重复定义 问题分析与处理
  16. AAAI 2021 Structured Co-reference Graph Attention for Video-grounded Dialogue
  17. 嵌套iframe页面做打印去掉页眉页脚
  18. 上海社保金额精确计算公式
  19. 说说毕业后这十多天的社会生活
  20. 计算机专业专科可以进的国企,专科毕业生想进国企?这三大专业不要错过,成功率高达60%...

热门文章

  1. navicat8.0版本注册码,已试可用
  2. java项目如何分工合作,JavaWeb基础 jsp+servlet分工合作的简单示例
  3. 国外注册域名和国内注册有什么不同?
  4. java的入口函数_java入口函数有几种
  5. 记录_20190626
  6. 2020年7月5日第十一届蓝桥杯第一场省赛试题及详解(Java本科B组)
  7. Bootstrap03
  8. 我的博客搬家至blogbus.com
  9. 基于C51单片机的DA方波可控制发生器
  10. 职场语言的特征3p1A7C指什么,商务礼仪选择题和答案