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

后端 未结 28 2592
星月不相逢
星月不相逢 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:10

    You can also set the HTTP proxy that Git uses in global configuration property http.proxy:

    git config --global http.proxy http://proxy.mycompany:80
    

    To authenticate with the proxy:

    git config --global http.proxy http://mydomain\\myusername:mypassword@myproxyserver:8080/
    

    (Credit goes to @EugeneKulabuhov and @JaimeReynoso for the authentication format.)

提交回复
热议问题