If it is git clone http://or Git clone https://, you can add the proxy server to the environment variable directly.
$ export http_proxy= "Http://username:[email protected]:3128/" $ export https_proxy= "Http://username:[email protected] : 3128/"
If Git clone git://is a bit of a hassle (maybe Git feeds don't provide http/https), you'll need to install SOCAT, install the path in Usr/share/doc/socat
Then create a script called Gitproxy and fill in the appropriate server address, port number, etc., and finally configure Git to use the Gitproxy script:
$ sudo apt-get install socat$ sudo vi/usr/bin/gitproxy#!/bin/bashproxy=squid.vpsee.comproxyport=3128proxyauth= Username:passwordexec socat STDIO PROXY: $PROXY: $1:$2,proxyport= $PROXYPORT, proxyauth= $PROXYAUTH $ sudo chmod +x/usr/ share/doc/socat/gitproxy$ git config--global core.gitproxy/usr/share/doc/socat/gitproxy
Using Git with proxies in Ubuntu