Last active
January 20, 2020 17:20
-
-
Save goncha/4591538 to your computer and use it in GitHub Desktop.
Git and socks5 proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gang@debian:~$ sudo apt-get install netcat-openbsd | |
gang@debian:~$ cat /usr/local/bin/git-proxy-wrapper | |
#!/bin/bash | |
nc -xlocalhost:1080 -X5 $* | |
gang@debian:~$ export GIT_PROXY_COMMAND=/usr/local/bin/git-proxy-wrapper |
@MatrixMuto
你没搞懂,你那个是git走的是http(s)协议,需要的是git协议走socks
git clone git@xxxxx
而不是
git clone http://xxxxx
那个GIT_PROXY_COMMAND基本没有用,完整、实用的设置看这里
https://gist.github.com/coin8086/7228b177221f6db913933021ac33bb92
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
新一点的Git版本,用下面的配置就可以了,
git config --global http.proxy 'socks5://127.0.0.1:7070'
git config --global https.proxy 'socks5://127.0.0.1:7070'
参考