Cocoapods使用及git版本管理

1、git.oschina.net上新建私有项目CocoaPodsTest,拷贝git路径留作下一步使用

2、本次mac上新建xcode项目CocoaPodsTest

3、在命令行cd到项目根路径/Users/cyber/Documents/Projects/CocoaPodsTest执行以下命令

git init

git remote add origin https://git.oschina.net/cybxcoder/CocoaPodsTest.git

git pull origin master

git add .

git commit -m 'cocoapods test'

git push origin master

执行完上述命令后完成与git库的对接,代码纳入git版本管理

4、执行pod search SVPullToRefresh查看执行结果

undefined

其中 pod 'SVPullToRefresh', '~> 0.4.1'需加入Podfile

5、在项目根目录下/Users/cyber/Documents/Projects/CocoaPodsTest新创建Podfile

vim Podfile

在Podfile写入以下信息并退出保存文件

undefined

6、在项目根目录下执行pod install命令,如是扩展添加第三方库,则在Podfile添加对应记录后执行pod update命令,即可自动安装新加入的库

7、要不定期执行pod setup命令,刷新pod服务器上最新库清单,否则执行pod search时可能找不到结果

原文地址:https://www.cnblogs.com/wolfcamel/p/4302439.html