windows下
@echo off
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
c:
cd %APPDATA%
echo proxy="http://127.0.0.1:7890" > _curlrc
@echo on
@echo off
git config --global --unset http.proxy
git config --global --unset https.proxy
c:
cd %APPDATA%
del _curlrc
@echo on
linux 下
#!/bin/bash
export http_proxy="http://127.0.0.1:7890"
export https_proxy="http://127.0.0.1:7890"
export all_proxy="http://127.0.0.1:7890"
git config --global http.proxy 'http://127.0.0.1:7890'
git config --global https.proxy 'http://127.0.0.1:7890'
echo proxy="http://127.0.0.1:7890" > ~/.curlrc
cd ~/soft/clash
./clash-linux-amd64-v3-v1.18.0 -d .
sudo echo \
'Acquire {HTTP::proxy "http://127.0.0.1:7890"; HTTPS::proxy "http://127.0.0.1:7890";}'\
>> /etc/apt/apt.conf.d/proxy.conf
#!/bin/bash
git config --global --unset http.proxy
git config --global --unset https.proxy
rm -f ~/.curlrc
unset http_proxy
unset https_proxy
unset all_proxy
sudo rm /etc/apt/apt.conf.d/proxy.conf