Original: Various SCM tools using HTTP proxy download Source: http://www.linuxeden.com/html/develop/20090723/66951.html
SCM is the abbreviation of software configuration management, Common SCM system has CVS,SVN,HG (Mercurial) and git, etc.
Often there is the need to use SCM to download the source code, especially software developers. But our network environment often forces us to use proxies, either because of speed, or because the direct connection simply doesn't make sense. And the source code is usually a fragmented thousands of tens of thousands of small files, unlike the general software is a single file, a download tool can be done.
1,cvs
CVS is cumbersome to use proxies, and it doesn't seem to be possible to use an HTTP proxy (if I'm wrong to remind you), and the socks agent is pretty hard to find. Fortunately this thing has slowly become yesterday yellow flower, we do not discuss it.
2,svn
SVN is convenient, edit ~/.subversion/servers file can:
[Global]
Http-proxy-host = < agent's IP or domain name >
Http-proxy-port = < proxy port >
Http-proxy-username = < username, if required >
Http-proxy-password = < password, if required >
3,hg
HG is simpler because it uses the HTTP protocol, a command to resolve:
Export http_proxy=http://< username >:< password >@<ip>:< ports >
4,git
Git can use two kinds of protocols, GIT protocol and HTTP, if the latter, then the same way as HG, if it is git, it is troublesome, but it is not unresolved:
Go ahead and download a protocol conversion gadget: HTTP://WWW.MEADOWY.ORG/~GOTOH/SSH/CONNECT.C
Compiled by: Gcc-o Connect connect.c
Place the generated connect in the executable path, such as/usr/bin
Then create a script that uses the proxy, assuming that it is HTTP-PROXY-GW, with the following executable attributes:
#!/bin/sh
# Filename: ~/BIN/HTTP-PROXY-GW
# This script connects to an HTTP proxy using connect.c
Connect-h http://yourproxyaddress:proxyport [email protected]
Finally, configure Git:
git config--global core.gitproxy "HTTP-PROXY-GW for Xxx.yyy"
The xxx.yyy behind is the domain suffix, for example, to download the Linux source code can be set to kernel.org
Methods for using HTTP proxies under various code versioning tools