cmd, npm and git proxy settings and removal

1. Cmd proxy settings
Open cmd (win + R, enter cmd, then press enter), and then enter the following command:

set http_proxy=http://proxy.yourname.com:8080

Where http://proxy.yourname.com is your proxy server address, and 8080 is the port number. If your proxy server requires a username and password, you also need:

set http_proxy_user=
set http_proxy_pass=

After the setting is completed, you can use the network normally under cmd.

2、cmd代理清除
eg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings” /v ProxyEnable /t REG_DWORD /d 0 /f

3、npm代理设置
npm config set proxy=http://proxy.yourname.com:8080

4. npm proxy clear
npm config delete proxy

5. git proxy settings
git config --global http.proxy http://proxy.yourname.com:8080

If you need a username and password, set:

git config –global http.proxy http://user:password@http://proxy.yourname.com:8080

Among them, user and password are your username and password respectively.
After the setting is completed, you can use the following command to check whether the setting takes effect:

git config –get –global http.proxy

6, git proxy clear
git config --system (or --global or --local) --unset http.proxy

Guess you like

Origin blog.csdn.net/qq_41454044/article/details/102513814