xucuncicero
V2EX  ›  问与答

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

  •  1
     
  •   xucuncicero · Aug 30, 2016 · 5164 views
    This topic created in 3573 days ago, the information mentioned may be changed or developed.

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

    上述命令不知道为什么不行,我直接修改.gitconfig 文件发现可以生效了, win 下各种不明白的坑。
    hardywu
        3
    hardywu  
       Dec 27, 2016
    @xucuncicero windows 下符号 ” 自动被忽略
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3244 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 523ms · UTC 02:51 · PVG 10:51 · LAX 19:51 · JFK 22:51
    ♥ Do have faith in what you're doing.