linux的比較簡單,直接修改配置文件即可攀芯,這里就不再贅述
設(shè)置Git代理
http代理:
臨時代理:
export http_proxy=http://127.0.0.1:7777
export https_proxy=http://127.0.0.1:7777
永久代理:
命令方式:
git config --global http.proxy http://127.0.0.1:50015
git config --global https.proxy http://127.0.0.1:50015
修改配置文件方式
進(jìn)入用戶名根路徑阳准,找到 .gitconfig 文件,修改(地址和端口換成自己的)為:
[http]
proxy = http://127.0.0.1:50015
[https]
proxy = http://127.0.0.1:50015
查看http (s)代理情況:
git config --get --global http.proxy
git config --get --global https.proxy
永久代理 - SOCKS5 代理設(shè)置
命令方式:
git config --global http.proxy socks5://127.0.0.1:50014
git config --global https.proxy socks5://127.0.0.1:50014
修改配置文件方式:
進(jìn)入用戶名根路徑苍柏,找到 .gitconfig 文件画切,修改(地址和端口換成自己的)為:
[http]
proxy = socks5://127.0.0.1:50015
[https]
proxy = socks5://127.0.0.1:50015
查看SOCKS5 代理情況:
git config --get --global http.proxy
git config --get --global https.proxy
git config --get --global http.proxy socks5
git config --get --global https.proxy socks5
git取消http(s)或socks代理:
git config --system (或 --global 或 --local) --unset http.proxy
例:
git config --global --unset http.proxy
git config --global --unset https.proxy
----------------------------------------------------------------------------------------------------------------------------------------
設(shè)置CMD代理
CMD - http代理
cmd臨時代理方案(cmd窗口關(guān)閉,則代理失效)
set http_proxy=http://127.0.0.1:50015
set https_proxy=http://127.0.0.1:50015
cmd永久代理方案
netsh winhttp import proxy source=ie
CMD - SOCKS5 代理設(shè)置
set http_proxy=socks5://127.0.0.1:50014
set https_proxy=socks5://127.0.0.1:50014
CMD(服務(wù)器)針對性代理长踊,繞過本地請求(修改為自己的代理地址和端口)
http:
netsh winhttp set proxy proxy-server="http=192.168.17.100:50015" bypass-list="localhost"
https:
netsh winhttp set proxy proxy-server="http=192.168.17.100:50015" bypass-list="localhost"
socks:
netsh winhttp set proxy proxy-server="socks=192.168.17.100:50015" bypass-list="localhost"
CMD查看代理情況:
netsh winhttp show proxy
CMD取消代理:
netsh winhttp reset proxy