Git/repo proxy settings when downloading Android source code.

Source: Internet
Author: User

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

Related Article

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.