HTTP ProxyConfigure HTTP_PROXY Environment variables directly
git config http.proxy
Http.proxy
Override the HTTP proxy, normally configured using the Http_proxy, Https_proxy, and
All_proxy Environment Variables (Curl (1)). This can is overridden on a per-remote
Basis Remote.<name>.proxy
To configure a separate HTTPS proxy for a fixed remote
Remote.<name>.proxy
For remotes so require curl (HTTP, HTTPS and FTP), the URL to the proxy to
Remote. Set to the empty string to disable proxying for this remote.
How to use:
git config http.proxy 192.168.2.1
GIT AgentGit protocol's port number is 9418, the opening of this port proxy server is not many, here directly with HTTPS agent converted to git agent
First configure the HTTP protocol proxy server and then require Socat Zuo http to git protocol conversion
Netcat-openbsd or Socat to connect through as follows ...
Install ' Socat '. For example, on Debian/ubuntu, just ' sudo apt-get install Socat '.
Create a script called ' Gitproxy ' in your bin directory;
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14-15 16 |
#!/bin/sh # Use Socat to proxy git through an HTTP CONNECT firewall. # Useful if you are are trying to clone git://from inside a. # Requires that ' proxy allows CONNECT to port 9418. # # Save This file as Gitproxy somewhere in your path (e.g., ~/bin) and then run # chmod +x Gitproxy # git config--global core.gitproxy gitproxy # # More details at Http://tinyurl.com/8xvpny # Configuration. Common proxy ports are 3128, 8123, 8000. _proxy=proxy.yourcompany.com _proxyport=3128 EXEC socat STDIO Proxy:$_proxy:$1:$2,proxyport=$_proxyport |
View Raw Gitproxy-socat This is Gist brought to and by GitHub.
You'll need to replace proxy.yourcompany.com with the name of your proxy host and the port used by the pro XY (common ports include 3128, 8123 and 8000). (If the JavaScript is broken, visit [Gist 49288][gist] and download the raw file; The original commands as Reproduc Ed in the comments.)
Configure ' git ' to use it:
$ git config--global core.gitproxy gitproxy
That ' s it! Your git clone commands should now transparently accept git://URLs.
SSH Agent first to ensure that the proxy server can have SSH connection destination server permissions configuration ssh vi/home/jxdong/.ssh/config
Host git.host.com
User gitolite
Hostname 192.168.1.1
proxycommand ssh git@git.proxy.com NC%h%p