工具- Git设置代理与Cocoapods

1,851 阅读1分钟

git

  • Git设置代理
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global http.proxy 'socks5://127.0.0.1:1080' 
git config --global https.proxy 'socks5://127.0.0.1:1080'

取消
git config --global --unset http.proxy
git config --global --unset https.proxy
  • 查看localhost
nslookup localhost

=============================================

Server:		10.1.8.10
Address:	10.1.8.10#53

Name:	localhost
Address: 127.0.0.1


  • 查看当前终端IP命令
curl cip.cc

IP	: 60.1.34.3
地址	: 中国  浙江  杭州
运营商	: 电信

数据二	: 浙江省杭州市 | 电信
  • 查看终端是否走代理 使用 curl -vv
curl -vv https://www.google.com 

cocoapods

CocoaPods换源

//查看
pod repo
master// master这个Specs的名字,后期要remove需要用到这个名字
- Type: git (master)
- URL:  https://mirrors.bfsu.edu.cn/git/CocoaPods/Specs.git //非官方源
- Path: /Users/baofan/.cocoapods/repos/master

//移除 master源
pod repo remove master

//更换源
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
pod repo update