关于后端:终端设置代理

2次阅读

共计 617 个字符,预计需要花费 2 分钟才能阅读完成。

起因

因为之前 git clone 或者相似操作经常出现问题,但我自身开了代理的,所以不晓得出了什么问题,前面才晓得须要另外设置代理,这里总结一下不同平台终端开启代理形式。

git bash

设置代理,留神端口号是你代理软件的端口

git config --global http.proxy http://127.0.0.1:9080
git config --global https.proxy https://127.0.0.1:9080

如果是其余协定,间接更改前面的值即可 http.proxyhttps.proxy

重置代理

git config --global --unset http.proxy
git config --global --unset https.proxy

Windows powershell

$env:HTTP_PROXY="http://127.0.0.1:9080"
$env:HTTPS_PROXY="https://127.0.0.1:9080" 

Windows CMD

set http_proxy=http://127.0.0.1:9080
set https_proxy=http://127.0.0.1:9080

MAC iterm2

export http_proxy=http://127.0.0.1:9080
export https_proxy=$http_proxy

重置代理

unset http_proxy https_proxy

本文由 mdnice 多平台公布

正文完
 0