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

git config --local https.proxy https://127.0.0.1:1080 我这样配置有什么问题么?为什么还是没走ss代理呢?

 

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

请问一下,我只设置了git config --global https 而没设置git config --global http的时候,clone一个google的git仓库依然不行,后来加上了http的设置才可以,我也是ss代理 端口都和你们一样,有人知道这是为什么吗? 我的clone仓库url是https的啊,但还是需要把http和https代理都挂上才可以吗?

 

@zhuyingda 显然是 https 不起作用,只有 http 起作用

My ubuntu server was blocked to git clone some github repo,

Do as @itolfh said,

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

git config --global https.proxy 'socks5://127.0.0.1:1080'

my git works!
Thanks @itolfh

按照

#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080 #取消代理
git config --global --unset http.https://github.com.proxy)

设置
速度感人!!!

我如此设置之后clone gist同样没有被代理

git设置

[http]
proxy = socks5://127.0.0.1:1080
[https]
proxy = socks5://127.0.0.1:1080

本地ss5端口

$ nmap localhost
Starting Nmap 7.01 ( https://nmap.org ) at 2017-03-28 23:05 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000035s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
1080/tcp open socks Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds

ss查看开放端口信息

$ ss -tln | grep 1080
LISTEN 0 128 127.0.0.1:1080 *:*

我确信ss5已经打开并且能用,毕竟浏览器能用。
但是在

$ git clone https://gist.github.com/666dd7b27e9116faece6.git
正克隆到 '666dd7b27e9116faece6'...
fatal: unable to access 'https://gist.github.com/666dd7b27e9116faece6.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

出现如上错误,我不知道是不是我的git设置问题呢。在这里提问抱歉了。我也google搜索了很久,只有在您这里提到了设置ss5。
谢谢

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

注意: 代理地址不要加引号!
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
大部分网站下载没问题, 但是遇到 gclient 下载会出错, 去掉引号号后成功

问下 我想代理 git://git.com 这种开头应该怎么加 ,试了下 不行

@zhangle1 使用 git@xxoo.com 这种方式,是用的 SSH 协议。需要在 ~/.ssh/config 目录下配置

Host xxoo.com(改成你的站点)
ProxyCommand connect -H 127.0.0.1:1080 %h %p

补充两点:
1, https.proxy设置是无用的, 只需要设置http.proxy
2, socks5h://更好, 远端DNS

对于使用git@协议的,可以配置socks5代理
在~/.ssh/config 文件后面添加几行,没有可以新建一个

Host github.com
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p

多次 set/unset 之后, 通过 git config --global -e 可以看到有好多空的 [http], [https]

怎么能够不产生多余的内容?

https.proxy 根本就不存在这个设置好吗
只有http.proxy是正确的 他负责所有的http[s]代理设置

git 是没有 https 这个 config section 的
如果想要使用SOCKS5代理的话只需要
git config --global http.proxy "socks5h://your_addr:your_port" 即可

 git config --global --unset http.https://github.com.proxy) 多了一个 )

为什么我还是不行啊 socks代理127.0.0.1:1080

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

https加上也不行
都是
: gnutls_handshake() failed: The TLS connection was non-properly terminated.

$ sudo curl -sSL  https://get.docker.com/ | sh
curl: (35) gnutls_handshake() failed: The TLS connection was non-properly terminated.

新装的系统,装docker的时候出现这个报错

解决方案是:

瞅下本机dns配置,/etc/resolv.conf

sudo vim /etc/resolv.conf

添加阿里的dns

nameserver  223.5.5.5
nameserver  223.6.6.6

就可以了

 

git 设置ss代理的更多相关文章

  1. git设置ss代理

    // 查看当前代理设置 git config --global http.proxy http/https协议 //设置代理(clone https://前缀的repo会走代理) git config ...

  2. git设置HTTP代理

    git设置HTTP代理 设置HTTP代理 如果公司使用代理,git就需要设置代理才能克隆远程仓库 执行下面两条语句 git config --global http.proxy 10.167.32.1 ...

  3. 主机设置ss代理,虚拟机共享代理

    代理的原理: 关于代理的具体的书面定义你百度谷歌可以知道.这里,我想简单通过一个例子,说明代理的原理: 假如,你在北京,但你女朋友在广州,你有东西要给你的女朋友,但是正好你这几天公司有事,所以你不能去 ...

  4. ssh协议git利用ss代理

    前言 不知道ss为何物的绕道 求帐号的绕道 这里只是亲测 ssh协议下的git, 如何判断是什么协议出门左拐 判断是否需要代理 我遇到的问题是: ssh_exchange_identification ...

  5. 为 git 设置 http 代理

    最近基于 PDFium 项目做一些东西.之前得了代码,今天想要更新到最新的,发现怎么都 pull 不下来.后来想起来,可能是 git 没有使用代理的原因.于是添加代理,果然更新成功. 在 git ba ...

  6. Git设置/取消代理

    设置代理 git config --global http.proxy http://proxy.com:1234 git config --global https.proxy http://pro ...

  7. intellij idea设置ss代理

  8. Git 设置 SOCKS 代理

    $ export all_proxy=socks5://127.0.0.1:1080

  9. powershell设置SS代理

    $env:HTTPS_PROXY="http://127.0.0.1:1080" $env:HTTP_PROXY="http://127.0.0.1:1080"

随机推荐

  1. k8s-高级调度方式-二十一

    两类: 节点选择器:nodeSelector(给node打上标签,pod通过标签预选节点),nodeName 节点亲和调度:nodeAffinity 1.节点选择器(nodeSelector,node ...

  2. JAVA基础--函数和数组03

    一.函数的引入 函数的引入 能把相同的代码都抽出来,放到一个地方,等到要使用的时候再去调用,如果有不同的数据,在使用的时候传递就行了: 2. 函数的概念:函数又叫方法,一段独立于代码块 直接卸载类中, ...

  3. 详解Supervisor进程守护监控

    Supervisor在百度百科上给的定义是超级用户,监管员.Supervisor是一个进程管理工具,当进程中断的时候Supervisor能自动重新启动它.可以运行在各种类unix的机器上,superv ...

  4. java实训 :异常(try-catch执行顺序与自定义异常)

    关键字: try:执行可能产生异常的代码 catch:捕获异常 finally:无论是否发生异常代码总能执行 throws:声明方法可能要抛出的各种异常 throw:手动抛出自定义异常 用 try-c ...

  5. Python基础知识(2)

    1:if比较运算符.and.or >=:大于或者等于 <=:小于或者等于 ==:等于 !=:不等于  (<>:也是不等于,在Python2中可用.Python3中无法使用) a ...

  6. the little schemer 笔记(8)

    第八章 lambda the ultimate 还记得我们第五章末的rember和insertL吗 我们用equal?替换了eq? 你能用你eq?或者equal?写一个函数rember-f吗 还不能, ...

  7. AtCoder Grand Contest 017 A

    Problem Statement There are N bags of biscuits. The i-th bag contains Ai biscuits. Takaki will selec ...

  8. Queue Sequence HDU - 4441

    码力不行啊... 错误记录: 171行后面对find2的使用错误,原来写的是p=find2(rt,p1),然后再加上一句能过样例但很假的特判 事实上,现在是要寻找最大的j,使得d2[1..j-1]=p ...

  9. Monitor CodeForces - 846D

    题目 题意:有一个n*m的显示屏,有q个坏点先后出现,已知第i个坏点位置为(xi,yi),在ti时间出现.显示屏上出现一个k*k的矩阵全都是坏点时显示屏就是坏的.输出显示屏坏的时间,如果不会坏就输出- ...

  10. 从一个n位数中选出m位按顺序组成新数并使其最大 || Erasing and Winning UVA - 11491

    就是从n位数中取出n-d个数字按顺序排成一排组成一个新数使得其最大 算法: 从前往后确定每一位.找第i位时,要求后面留下d-i位的空间, 因此第i位应该从第i-1位原来位置+1到第d+i位寻找 用线段 ...