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

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

    The below method works for me:

    echo 'export http_proxy=http://username:password@roxy_host:port/' >> ~/.bash_profile
    echo 'export https_proxy=http://username:password@roxy_host:port' >> ~/.bash_profile
    
    • Zsh note: Modify your ~/.zshenv file instead of ~/.bash_profile.
    • Ubuntu and Fedora note: Modify your ~/.bashrc file instead of ~/.bash_profile.

提交回复
热议问题