Using Git with proxies in Ubuntu

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.