Set git / npm / bower / pip / gem mirror or agent

git

Setting:

$ git config --global http.proxy http://proxy.mysite.com

cancel:

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

asl

Proxy settings:

$ npm config set proxy=http://proxy.mysite.com

Cancel Agent:

$ npm config delete proxy

Set up a mirror:

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

Or the installation of designated:

$ npm install --registry https://registry.npm.taobao.org XXX

Or you may use nrmthis module to switch the image

// install nrm

$ npm install -g nrm

// View Mirror

$ nrm ls

// speed contrast image

$ nrm test

// using Taobao mirror

$ nrm use taboo

You may also be added the following content ~ / .npmrc

registry = https://registry.npm.taobao.org

Unmirror:

$ npm config delete registry

Deletion of the corresponding content or

bower

Setting:

Modify .bowerrc file

{
    "proxy": "http://proxy.mysite.com",
    "https-proxy": "http://proxy.mysite.com"
}

cancel:

Delete the corresponding configuration.

pip

Set up a mirror:

$ pip install -i http://pypi.douban.com/simple Django

Or you can modify the configuration file, Linux / Unix / MacOS in $HOME/.pip/pip.conf, windows in C:\Users\Administrator\pip\pip.ini:

[global]
find-links =
http://pypi.douban.com
http://e.pypi.python.org

All commands will now retrieve watercress Mirror, Mirror Tsinghua after retrieving each image to its own line.
You can also specify a special command, such as pip installl only use the mirror:

[install]
find-links =
http://pypi.douban.com
http://e.pypi.python.org

gem

Set up a mirror:

$ gem sources -a http://ruby.taobao.org/

Unmirror:

$ gem sources -r http://ruby.taobao.org/

Use proxy:

Plus the installation --http-proxyparameters

$ gem install --http-proxy http://ruby.taobao.org/ sass

RubyGems also to the package to the local and mounting gem

$ gem install --local sass.gem

But the most effective way is not to change sources, because if you use rails every time rails are used by default when the project was created https://rubygem.org as the download source, as long as we will all be sent to https://rubygem.org of mirror request to https: //ruby.taobao.orgy on the line.

bundle config mirror.https://rubygems.org https://ruby.taobao.org

Reproduced in: https: //www.cnblogs.com/Ray-liang/p/5589884.html

Guess you like

Origin blog.csdn.net/weixin_33950035/article/details/94195986