git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
bingoAI
0.01D
V2EX  ›  git

如何突破公司访问限制访问 github

  •  
  •   bingoAI · Sep 26, 2017 · 7070 views
    This topic created in 3242 days ago, the information mentioned may be changed or developed.

    1 使用了 git config --global url."https://".insteadOf git://

    2 使用了 git config --global http.proxy [公司 proxy IP ]

    3 改变端口 Host github.com User [email protected] Hostname ssh.github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa Port 443

    ssh -T [email protected]
    ssh: connect to host ssh.github.com port 443: Connection timed out
    ute@3-5-CLOUD503:~/.ssh$ vim config
    

    。。。。

    6 replies    2017-09-28 09:37:39 +08:00
    aru
        1
    aru  
       Sep 26, 2017
    ysc3839
        2
    ysc3839  
       Sep 26, 2017 via Android
    你这个说的不明不白的,仓库到底用的是什么协议?据我所知 GitHub 不支持 git 协议,只支持 https 和 ssh 协议。
    https 协议的话,还要加个 git config --global https.proxy http://host:port
    ssh 协议的话,直接设置走代理不方便,我的建议是用
    SOCKS 端口转发,$$R 也自带有端口转发的功能。
    ysc3839
        3
    ysc3839  
       Sep 26, 2017 via Android
    另外,可以直接用环境变量设置代理
    export all_proxy=http://host:port
    没记错的话,Git 通过 curl 来进行 http/https 请求,具体代理格式可以看 curl 的文档。
    https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html
    Marfal
        4
    Marfal  
       Sep 26, 2017
    @ysc3839 支持 git 协议,需要在 ~/.ssh/config 里设置
    Host github.com
    HostName github.com
    User git
    ProxyCommand nc -v -x 127.0.0.1:8080 %h %p
    ysc3839
        5
    ysc3839  
       Sep 26, 2017 via Android
    @Marfal 你这里说的是 ssh 协议吧?
    bingoAI
        6
    bingoAI  
    OP
       Sep 28, 2017
    感谢以上 V 友,待会儿就去试试。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3481 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 04:49 · PVG 12:49 · LAX 21:49 · JFK 00:49
    ♥ Do have faith in what you're doing.