The background of this article is what I encountered when I configured the android environment in Ubuntu and obtained the android source code. I don't know much about how to use the android environment in Ubuntu/Linux, for details, refer to the official website of Android. The link is http://source.android.com/source/download.html. The following describes how to download source code within the company's intranet.
There are many ways to set up git proxy on the Internet, but they are similar. The following describes my solutions.
1. on Linux/Ubuntu machine, please install connect-proxy
# Sudo apt-Get install connect-proxy
2. Create a simple shell script named socks-gw.sh
#! /Bin/sh
# Filename :~ /Bin/socks-GW
# This script connects to a SOCKS proxy
Connect-proxy-s your.socks.proxy.com: Port $ @
3. edit a simple shell script named socks-ssh.sh
#! /Bin/sh
# Filename :~ /Bin/socks-ssh
# This script opens an SSH connection through a SOCKS Server
Ssh-O proxycommand = "$ {home}/bin/socks-GW % H % P" $ @
4. edit a simple shell script named proxy. Sh
#! /Bin/sh
# Filename :~ /Bin/Proxy
# This script sets git to use the socks proxy
Export git_ssh = "$ {home}/bin/socks-ssh"
Export git_proxy_command = "$ {home}/bin/socks-GW"
Note: Please make sure Socks-ssh and socks-GW in the right path
5. Execute proxy. Sh every time before you want to use git.
Notes:
1. Many documents on the Internet have mentioned downloading a connect. c file and then compiling it. In fact, the connect. c file is the connect-proxy we installed.
2. -S refers to the socks proxy and-H refers to the HTTP proxy. Pay attention to the differences between socks proxy and HTTP proxy, google
3. If you want to use HTTP proxy, many methods on the Internet will be used.
Reference: http://threebytesfull.com/2008/04/git-with-and-without-proxy