git配置代理

git代理

删除命令

1
$ git config --global --unset [name]

添加git config配置

1
$ git config --global [name] [value]
1
2
3
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890
git config -l

npm代理

1
2
3
4
5
npm config set proxy=http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890

npm config delete proxy
npm config delete https-proxy

apt代理

1
2
3
4
5
6
7
8
9
10
11
12
13
APT configuration file method

This method uses the apt.conf file which is found in your /etc/apt/ directory. This method is useful if you only want apt-get (and not other applications) to use a http-proxy permanently.

On some installations there will be no apt-conf file set up. Edit apt-conf file (or create a new one if you have no one yet) using the editor of your choice.

> sudo nano /etc/apt/apt.conf

Add this line to your /etc/apt/apt.conf file (substitute your details for yourproxyaddress and proxyport).

> Acquire::http::Proxy "http://yourproxyaddress:proxyport";

Save the apt.conf file.

全局代理(貌似不管用)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export all_proxy=socks5://127.0.0.1:7891
export no_proxy="127.0.0.1,localhost,*.local.com"

export http_proxy=http://[::]:7890
export https_proxy=http://[::]:7890
export all_proxy=socks5://[::]:7891
export no_proxy="127.0.0.1,localhost"

export no_proxy="localhost,127.0.0.0/8,*.local"
export NO_PROXY="localhost,127.0.0.0/8,*.local"
export all_proxy=socks://127.0.0.1:7891/
export ALL_PROXY=socks://127.0.0.1:7891/
export http_proxy=http://127.0.0.1:7890/
export HTTP_PROXY=http://127.0.0.1:7890/
export ftp_proxy=http://127.0.0.1:7890/
export FTP_PROXY=http://127.0.0.1:7890/
export https_proxy=http://127.0.0.1:7890/
export HTTPS_PROXY=http://127.0.0.1:7890/

env | grep proxy

unset no_proxy
unset NO_PROXY
unset all_proxy
unset ALL_PROXY
unset http_proxy
unset HTTP_PROXY
unset ftp_proxy
unset FTP_PROXY
unset https_proxy
unset HTTPS_PROXY

git配置代理
https://zhaosn.github.io/2022/git_proxySet/
作者
Zhao SN
发布于
2022年1月15日
更新于
2022年10月28日
许可协议