网上搜了几个貌似都不行了,就在 coding.net 上建了一个镜像。
替换现有源为 Coding 镜像源:
git -C ~/.cocoapods/repos/master remote set-url origin https://git.coding.net/ElfSundae/Specs.git
如果上面的命令出错就运行下面这个:
pod repo remove master
git clone https://git.coding.net/ElfSundae/Specs.git ~/.cocoapods/repos/master
更新源(可选)
pod repo update
记得在项目的 Podfile 中添加 source ,否则 pod update 时会恢复成官网源。
# source 'any/other/source'
source 'https://git.coding.net/ElfSundae/Specs.git'
...
- 镜像仓库: https://coding.net/u/ElfSundae/p/Specs/git
- 目前是半小时同步一次
- 512KB/s 应该是 Coding 的限速峰值,不过很稳定,我这边 GitHub 是 100KB 左右,当然还有丢包,所以比 GitHub 快至少 5 倍