1、首先去github上下载.zip文件:https://github.com/CocoaPods/Specs

2、将下载的
master.zip
解压出来,解压后的文件目录:
3、将解压出来的文件目录复制到 /.cocoapods/repos/master 目录:

4、 然后cd到master目录:
cd ~/.cocoapods/repos/master
5、初始化git:
git init
6、关联仓库:
git remote add origin https://github.com/CocoaPods/Specs
7、查看我们的repo是否正常,终端输入,结果如图:
pod repo list

8、 最后测试下 pod search 和 pod install,都可以正常使用了。
TIP:
你会发现clone 的文件很大,由于速度也很慢,一不小心就失败了。
其实我们无需全部 clone 下来,可以只 clone 最近一个 commit 的全部代码就可以了。
git clone --depth=1 https://github.com/CocoaPods/Specs.git master
网友评论