当前位置:   article > 正文

制作cocoapods国内镜像_cocoapods 设置国内镜像

cocoapods 设置国内镜像

国内访问cocoapods spec repo速度非常慢,网络不好的话做一次pod update要等半个小时以上。

初始化:
git clone --mirror https://github.com/CocoaPods/Specs.git
编辑config文件
[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
[remote "origin"]
        fetch = +refs/heads/*:refs/heads/*
        fetch = +refs/tags/*:refs/tags/*
        mirror = true
        url = https://github.com/CocoaPods/Specs.git
[remote "mirrors"]
        url = git@gitcafe.com:lloydsheng/Specs.git
        mirror = true
        skipDefaultUpdate = true
定期同步:
  • 编辑同步脚本specssync.sh,添加:
git fetch remote
git push mirrors
  • 设置cronjob每半个小时同步一次
30 * * * * /home/git/specssync.sh  > /var/log/specssync.log 2>&1

使用镜像:

pod repo remove master
pod repo add master git@gitcafe.com:lloydsheng/Specs.git

最后,如果你不想花时间自己搭的话,可以使用我在gitcafe上搭建好了的镜像。
https://gitcafe.com/lloydsheng/Specs

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/929484
推荐阅读
相关标签
  

闽ICP备14008679号