How do I pull from a Git repository through an HTTP proxy?

后端 未结 28 2234
星月不相逢
星月不相逢 2020-11-22 11:57

Note: while the use-case described is about using submodules within a project, the same applies to a normal git clone of a repository over HTTP.

I have

相关标签:
28条回答
  • 2020-11-22 12:04

    When your network team does ssl-inspection by rewriting certificates, then using a http url instead of a https one, combined with setting this var worked for me.

    git config --global http.proxy http://proxy:8081
    
    0 讨论(0)
  • 2020-11-22 12:04

    For Windows

    Goto --> C:/Users/user_name/gitconfig

    Update gitconfig file with below details

    [http]

    [https]

    proxy = https://your_proxy:your_port
    

    [http]

    proxy = http://your_proxy:your_port
    

    How to check your proxy and port number?

    Internet Explorer -> Settings -> Internet Options -> Connections -> LAN Settings

    0 讨论(0)
  • 2020-11-22 12:04

    $http_proxy is for http://github.com.... $https_proxy is for https://github.com...

    0 讨论(0)
  • 2020-11-22 12:05

    This worked to me.

    git config --global http.proxy proxy_user:proxy_passwd@proxy_ip:proxy_port
    
    0 讨论(0)
  • 2020-11-22 12:05

    I got around the proxy using https... some proxies don't even check https.

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    c:\git\meantest>git clone http://github.com/linnovate/mean.git
    Cloning into 'mean'...
    fatal: unable to access 'http://github.com/linnovate/mean.git/': Failed connect
    to github.com:80; No error
    
    c:\git\meantest>git clone https://github.com/linnovate/mean.git
    Cloning into 'mean'...
    remote: Reusing existing pack: 2587, done.
    remote: Counting objects: 27, done.
    remote: Compressing objects: 100% (24/24), done.
    rRemote: Total 2614 (delta 3), reused 4 (delta 0)eceiving objects:  98% (2562/26
    
    Receiving objects: 100% (2614/2614), 1.76 MiB | 305.00 KiB/s, done.
    Resolving deltas: 100% (1166/1166), done.
    Checking connectivity... done
    
    0 讨论(0)
  • 2020-11-22 12:06

    This isn't a problem with your proxy. It's a problem with github (or git). It fails for me on git-1.6.0.1 on linux as well. Bug is already reported (by you no less).

    Make sure to delete your pasties, they're already on google. Edit: Must've been dreaming, i guess you can't delete them. Use Gist instead?

    0 讨论(0)
提交回复
热议问题