V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
cyberscorpio
V2EX  ›  程序员

让 git 透过 sock5 (ssh tunnel) 存取 bitbucket 的方法

  •  
  •   cyberscorpio ·
    cyberscorpio · May 22, 2013 · 4451 views
    This topic created in 4728 days ago, the information mentioned may be changed or developed.
    也就是记录一下,从这里看来的: http://twopenguins.org/tips/git-through-proxy.php ,确实好使。

    1) 创建 ~/bin/proxy-wrapper 文件,内容是:
    #!/bin/bash
    nc -xproxy:port -X5 $*

    比如我的就是:
    nc -x127.0.0.1:8008 -X5 $*

    2) chmod +x ~/bin/proxy-wrapper
    将其置为可执行。

    3)命令行下
    - export GIT_PROXY_COMMAND="~/bin/proxy-wrapper"
    - git push origin dev

    在 ML 10.8.3 + openshift ssh tunnel 上亲测可行。

    以上,供参考。
    1 replies    1970-01-01 08:00:00 +08:00
    missdeer
        1
    missdeer  
       May 23, 2013   ❤️ 2
    更简单点,在~/.ssh/config里加上两行:
    Host bitbucket.org
    ProxyCommand nc -x 127.0.0.1:8080 -X 5 %h %p
    就可以了。
    要注意的是nc需要是OpenBSD版的,OSX自带了,Linux上有的发行版(比如Debian)得再装,Windows下有cygwin port版的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2699 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 13:41 · PVG 21:41 · LAX 06:41 · JFK 09:41
    ♥ Do have faith in what you're doing.