search

Home  >  Q&A  >  body text

How to set up a proxy for Git?

Recently, I can’t access Bitbucket frequently, and the speed of dragging code from Github is slow. Everyone knows the reason.
Therefore, the best way is to set up a proxy for Git. I hope to specify some warehouses to use the proxy method. I don’t know how to set it up?

To add another situation

In the local environment, I set up an ssh agent and go to 127.0.0.1:7070 through SOCKS. If the local ssh agent is turned on, Is there another way?

巴扎黑巴扎黑2809 days ago1940

reply all(12)I'll reply

  • 天蓬老师

    天蓬老师2017-05-02 09:35:57

    I think you may be asking this question.

    Question:
    E:PDFium>git clone https://pdfium.googlesource.com/pdfium
    Cloning into 'pdfium'...
    fatal: unable to access 'https://pdfium.googlesource.com/pdfium/' : Failed connect to pdfium.googlesource.com:443; No error

    Solution:
    git config --global http.proxy http://proxy.com:1234

    git config --global https.proxy http://proxy.com:1234
    git config --global http.sslverify false
    Reposted from: http://ricksu.blog.163.com/blog/static/18906433820125294929508/

    Reference: http://infong.net/config-proxy-for-git/

    I use a small software on my computer to circumvent the firewall, so I set it to

    E:PDFium>git config --global http.proxy http://127.0.0.1:8580
    E:PDFium>git config --global https.proxy https://127.0.0.1:8580
    E:PDFium>git config

    --global http.SSLVERIFY false

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-02 09:35:57

    On ubuntu 16.04 it can still look like this:

    In a terminal type:

    export all_proxy=socks://addr:port
    export ALL_PROXY=socks://addr:port

    Then all git operations performed on this terminal will go through the proxy

    If you want to cancel:

    unset all_proxy
    unset ALL_PROXY

    reply
    0
  • Cancelreply