git, npm,yarn常用代理设置

14,227 阅读1分钟

git 代理设置

设置

git config --global https.proxy 代理地址
git config --global http.proxy 代理地址

查看

git config --global  --get https.proxy
git config --global  --get https.proxy

查询的时候没有打印任何东西证明没有设置代理

取消

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

npm 设置代理

npm config set proxy http://10.22.129.20:8080
npm config set proxy https://10.22.129.20:8080

yarn 设置代理

切换源为国内淘宝镜像

yarn config set registry https://registry.npm.taobao.org

查看代理

yarn config list

设置

yarn config set proxy  http://username:password@server:port
yarn config set https-proxy http://username:password@server:port

取消

yarn config delete proxy<br />yarn config delete https-proxy