git clone 问题
转自 git clone出现 fatal: unable to access 'https://github.com/...'的解决办法(亲测有效) - 山村码农 - 博客园 (cnblogs.com)
<div id="cnblogs_post_body" class="blogpost-body cnblogs-markdown">
<p>转自:<a href="https://blog.csdn.net/dashi_lu/article/details/89641778" target="_blank" rel="noopener">https://blog.csdn.net/dashi_lu/article/details/89641778</a></p>
<pre highlighted="true"><code class="hljs language-verilog">
如下图所示,当我试图克隆别人的repo时,会发生这样的错误,当我从git:/而不是https:<span class="hljs-comment">//,克隆时,它工作得很好。</span>
发生这种情况是因为代理是在git中配置的。既然它是https代理(而不是http)git <span class="hljs-keyword">config</span> http<span class="hljs-variable">.proxy</span>和git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> http<span class="hljs-variable">.proxy</span>也无济于事。
解决方案一
<span class="hljs-number">1</span>、看看你的git配置
git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> -l
如果你没有任何与https代理相关的内容,例如https_proxy = ...问题不在这里。
如果您有与https代理相关的内容,请将其从〜/ <span class="hljs-variable">.gitconfig</span>文件中删除,然后重试。
<span class="hljs-number">2</span>、如果仍然不起作用,请取消设置环境变量
env|grep -i proxy
你应该有一行或几行https_proxy = ...
使用以下内容逐个取消设置:取消设置https_proxy(或HTTPS_PROXY,具体取决于变量的名称)
<span class="hljs-number">3</span>、再次检查环境变量
env|grep -i proxy
如果它没有显示任何你应该是好的。
注意:此解决方案可以应用于http和https代理问题。只是变量名称从https更改为http。
解决方案二
在开启shadowsock的前提下,手动配置git的代理。git客户端输入如下两个命令就可以了。
git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> http<span class="hljs-variable">.proxy</span> http:<span class="hljs-comment">//127.0.0.1:1080</span>
git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> https<span class="hljs-variable">.proxy</span> http:<span class="hljs-comment">//127.0.0.1:1080</span>
http:<span class="hljs-comment">//也可以改成sockets5://,但是区别在于:socks5不支持通过pubkey免密登录github,每次提交代码只能输入用户名和密码。http可以支持免密登录。</span>
取消代理:
git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> --unset http<span class="hljs-variable">.proxy</span>
git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> --unset https<span class="hljs-variable">.proxy</span>
其实方案一和方案二是同一种方法,不过方案二更加具体一点罢了,大部分问题都可以用方案二解决,当方案二无效时,考虑使用方案一。
</code></pre>
</div>
git clone 问题的更多相关文章
- git clone出现的error: The requested URL returned error: 401 Unauthorized
error: The requested URL returned error: 401 Unauthorized while accessing https://git.oschina.net/.. ...
- git clone Linux 源码并切换TAG
想从github上下载一个特定TAG分支来查看代码,按照先git clone后git checkout的方式,提示说有文件没有提交.因为只查看不编译运行,所以这些关系不大的文件采取删除或者重新命名后提 ...
- git clone时,报403错误,完美解决方案
首先命令行操作结果如下: root@zhiren-PowerEdge-T110-II:/zrun# git clone https://git.coding.net/xxxxxxxx/xxxx.git ...
- git clone error: RPC failed; result=22, HTTP code = 502
http://www.jianshu.com/p/645d3fe4e028 git克隆的工程太大用https的方式会有如下问题 hbl:tmp hubert$ git clone https://gi ...
- git clone带用户名和密码的方式
git clone http://username:password@127.0.0.1/res/res.git
- git clone错误
git clone错误 Initialized empty Git repository in ***/.git/ error: The requested URL returned error: 4 ...
- git clone google代码库
git clone https://chromium.googlesource.com/chromium/src 发现有将近7G,但是速度太慢,老是失败,提示信息先后是"The remot ...
- [译]git clone
git clone git clone命令copy一个已经存在的Git仓储. git clone有点像svn的checkout, 他的不同之处是这个copy也是一个完整的仓储-它有自己的历史纪录, 能 ...
- git clone
raw text for ssh: git@github.com:TommyU/avbot_config.git git command on linux: git clone git://githu ...
- 使用git建立远程仓库,让别人git clone下来
首先, 如果你的ssh没有安装的话,要安装ssh服务端.ubuntu是很简单 sudo apt-get install openssh-server 1,建立你的git 目录. ourunix@ubu ...
随机推荐
- css盒子模型、垂直外边距合并
css盒子模型由四部分组成:内容(content).填充(padding).边框(border).边距(margin),其中css样式中定义的width属性是定义内容区域的宽度,正常情况下,设置了内容 ...
- 不用关闭重启cad及不用更改快捷方式或者版本号c#调试cad插件
c#开发的cad插件需要重启cad才能进行调试,然而高版本的cad启动比较慢特别是一些古董电脑,而且cad有重启次数限制.针对不用重启cad调试已经有成熟的方案了,但是需要调试一次修改一次快捷方式或者 ...
- 99-oracle-asmdevices.rules(udev方式创建asm磁盘)
一.创建asm磁盘的几种方式 创建asm方式很多主要有以下几种 1.Faking方式 2.裸设备方式 3.udev方式(它下面有两种方式) 3.1 uuid方式. 3.2 raw方式(裸设备方式) 4 ...
- echarts饼图调整悬浮提示框的位置
默认是跟随鼠标的位置 通过数组表示提示框浮层的位置,数字设置绝对位置,百分比设置相对位置. position: [10,10] //绝对位置,相对于容器左侧10px,上侧10px position: ...
- Codeforces Round #767 (Div. 2) c d, 巧妙标记
贪心: Problem - C - Codeforces 思维: Problem - D - Codeforces 这两个题不错, 第一个需要考虑后面,就先标记完, 从前遍历挨个除去标记 第二个需要考 ...
- node.js - 路由、中间件、mysql
这几天天天搞到这么晚,我看今天的内容看起不多啊,不知道为什么学着学着就到了这么晚.今天的内容还是有点多哈,有点自我矛盾了,再次一一道来. 1. 首先今天先看到路由的概念,什么叫做路由? 路由就是映射关 ...
- APL 和 Web APL 的概述
APL APl ( Application ProgrammingInterface,应用程序编程接口) 是一些预先定义的函数,目的是提供应用程序 与开发人员基于某软件或硬件得以访问一组例程的能力,而 ...
- css 进阶实战项目
1. html 结构 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&quo ...
- 03. 树莓派初始配置——安装vim编辑器
安装vim编辑器 树莓派系统默认是不带vim编辑器的,默认安装的vi编辑器在编辑文档的时候用得特别不舒服,对人体的血压和树莓派的寿命影响较大. 解决办法:一行命令 1. 安装vim编辑器 sudo a ...
- 6.1 SHELL脚本
6.1 SHELL脚本元素 第一行的脚本声明(#!)用来告诉系统使用哪种Shell解释器来执行该脚本: 第二行的注释信息(#)是对脚本功能和某些命令的介绍信息,使得自己或他人在日后看到这个脚本内容时, ...