查看本地代码仓库命令
pod repo
在码云上新建远程仓库
注意需要将本地公钥传到码云设置上
本地生成共钥命令
ssh-keygen
id_rsa 是私钥, id_rsa.pub是公钥。
把公钥的内容填入码云仓库中就可以了
然后增加远程私有库
pod repo add DataStoreTool git@gitee.com:maochengfang/DataStoreTool.git
就可以万事大吉了
在本地创建一个私有库名字和远程仓库同名
git lib create DataStoreTool
pod lib create DataStoreTool
Cloning `https://github.com/CocoaPods/pod-template.git` into `DataStoreTool`.
Configuring DataStoreTool template.
/Users/maochengfang/Documents/2222/HHXX/remoteLab/DataStoreTool/setup/TemplateConfigurator.rb:207: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
! Before you can create a new library we need to setup your git credentials.
What is your email?
> maochengfang@126.com
! Setting your email in git to maochengfang@126.com
git config user.email "maochengfang@126.com"
------------------------------
To get you started we need to ask a few questions, this should only take a minute.
If this is your first time we recommend running through with the guide:
- https://guides.cocoapods.org/making/using-pod-lib-create.html
( hold cmd and double click links to open in a browser. )
What platform do you want to use?? [ iOS / macOS ]
> iOS
What language do you want to use?? [ Swift / ObjC ]
> Objc
Would you like to include a demo application with your library? [ Yes / No ]
> Yes
Which testing frameworks will you use? [ Specta / Kiwi / None ]
> None
Would you like to do view based testing? [ Yes / No ]
> Yes
What is your class prefix?
> TT
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Running pod install on your new library.
Analyzing dependencies
Downloading dependencies
Installing DataStoreTool (0.1.0)
Installing FBSnapshotTestCase (2.1.4)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `DataStoreTool.xcworkspace` for this project from now on.
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
Ace! you're ready to go!
We will start you off by opening your project in Xcode
open 'DataStoreTool/Example/DataStoreTool.xcworkspace'
To learn more about the template see `https://github.com/CocoaPods/pod-template.git`.
To learn more about creating a new pod, see `https://guides.cocoapods.org/making/making-a-cocoapod`.
cd 到项目中的Example文件夹下
pod install
maochengfang@maochenangdeMBP Example % pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
本地项目已经有了
本地仓库输入命令 git status git add . git commit -m 'first commit'
需要将本地仓库和远程仓库进行关联起来
git remote add origin https://gitee.com/maochengfang/DataStoreTool.git
提交代码到仓库
git push -u origin master
打标签tag
git tag 0.1.0
提交代码到0.1.0分支
修改DataStoreTool.podspec文件
#
# Be sure to run `pod lib lint DataStoreTool.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'DataStoreTool'
s.version = '0.1.0'
s.summary = 'DataStoreTool.'
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
DataStoreTool.DataStoreTool.DataStoreTool.DataStoreTool.DataStoreTool.DataStoreTool.
DESC
s.homepage = 'https://gitee.com/maochengfang/DataStoreTool/'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'maochengfang' => 'maochengfang@126.com' }
s.source = { :git => 'https://gitee.com/maochengfang/DataStoreTool.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '9.0'
s.source_files = 'DataStoreTool/Classes/**/*'
# s.resource_bundles = {
# 'DataStoreTool' => ['DataStoreTool/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
# 本地校验
# pod lib lint --allow-warnings --verbose --sources='https://gitee.com/maochengfang/DataStoreTool.git'
# 远程校验&&提交
#pod repo push DataStoreTool DataStoreTool.podspec --allow-warnings --verbose --sources='https://gitee.com/maochengfang/DataStoreTool.git'
end
# 本地校验
pod lib lint --allow-warnings --verbose --sources='https://gitee.com/maochengfang/DataStoreTool.git'
# 远程校验&&提交
pod repo push DataStoreTool DataStoreTool.podspec --allow-warnings --verbose --sources='https://gitee.com/maochengfang/DataStoreTool.git'
远程校验&&提交 成功的前提就是码云付费否则会出现
付费入口