V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
xucuncicero
V2EX  ›  问与答

怎么配置 win10 下 git 走 socks5 代理?

  •  1
     
  •   xucuncicero · 2016-08-30 18:30:10 +08:00 · 4326 次点击
    这是一个创建于 2794 天前的主题,其中的信息可能已经有所发展或是发生改变。

    win10 下,现在 git clone/pull 啥的搞不好就会断开或者连接超时,必须上代理了。

    文档中没找到配置 socks 代理的方式,按照网上的方法是这两句:

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

    现在的问题是这样配置以后 git 会自动走 443 端口,当然连接失败,不知道为什么.gitconfig 中的端口配置被吞了,求教该咋办?

    3 条回复    2016-12-27 13:51:36 +08:00
    Muninn
        1
    Muninn  
       2016-08-31 00:09:07 +08:00
    git 应该不支持 socks5 吧
    我是自己在云端用 ss 客户端加 polipo 搭建了个 http 然后 sh 和 git 这种都走这个 http
    xucuncicero
        2
    xucuncicero  
    OP
       2016-08-31 04:09:29 +08:00
    @Muninn git 较新版本是支持 socks5 的,具体从哪个版本不清楚,文档中没找到。

    上述命令不知道为什么不行,我直接修改.gitconfig 文件发现可以生效了, win 下各种不明白的坑。
    hardywu
        3
    hardywu  
       2016-12-27 13:51:36 +08:00
    @xucuncicero windows 下符号 ” 自动被忽略
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5974 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:17 · PVG 10:17 · LAX 19:17 · JFK 22:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.