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

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

    Worth to mention: Most examples on the net show examples like

    git config --global http.proxy proxy_user:proxy_passwd@proxy_ip:proxy_port
    

    So it seems, that - if your proxy needs authentication - you must leave your company-password in the git-config. Which isn't really cool.

    But, if you just configure the user without password:

    git config --global http.proxy proxy_user@proxy_ip:proxy_port
    

    Git seems (at least on my Windows-machine without credentials-helper) to recognize that and prompts for the proxy-password on repo-access.

提交回复
热议问题