Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the correct way to change the repo on a podspec?

I created my first cocoapod from a personal repo, and deployed it to cocoapods via the pod trunk push command. Since it is my first framework, I wanted to develop it on a personal repo to keep my messy commits private. Now that the product is ready, I need to migrate the work over to an open source repo, and update the cocoapod's source.

I tried changing the s.homepage and s.source lines of the podspec, but I get this fatal: Remote branch 1.0.0 not found in upstream origin error.

Updating spec repo `master`
Validating podspec
 -> EvolvKit (1.0.0)
    - ERROR | [iOS] unknown: Encountered an unknown error ([!] /usr/bin/git clone https://github.com/evolv-ai/EvolvKit.git /var/folders/jb/xlkpf4sn6fl9wtsh3g7pkqrh0000gp/T/d20190729-87754-7w53ir --template= --single-branch --depth 1 --branch 1.0.0

Cloning into '/var/folders/jb/xlkpf4sn6fl9wtsh3g7pkqrh0000gp/T/d20190729-87754-7w53ir'...
warning: Could not find remote branch 1.0.0 to clone.
fatal: Remote branch 1.0.0 not found in upstream origin
) during validation.

[!] The spec did not pass validation, due to 1 error and 1 warning.
➜  EvolvKit git:(master)

old pod spec:

Pod::Spec.new do |s|

# more configs
  s.homepage         = 'https://github.com/<personal_repo>/EvolvKit'
  s.license          = { :type => 'APACHE', :file => 'LICENSE' }
  s.author           = { 'PhyllisWong' => '[email protected]' }
  s.source           = { :git => 'https://github.com/<personal_repo>/EvolvKit.git', :tag => s.version.to_s }

# more configs
end

The new podspec lines changed:

  s.homepage         = 'https://github.com/<opensource_repo>/EvolvKit'
  s.source           = { :git => 'https://github.com/<opensource_repo>/EvolvKit.git', :tag => s.version.to_s }

Some things I tried are:

0. update git tag with version 1.0.0
1. updating the urls in the pod spec
2. clone the repo into a new directory, create a new git repo, and follow steps to trunk push
3. deleting the pod (was only able to delete versions) ...no one is using this pod btw.
4. considered changing the pod name, but that is less than ideal

Any ideas about a good way to go forward is greatly appreciated.

edit

Turns out I was missing a step in updating my repo with the git tag. Needed to push the tags.

like image 508
llamacorn Avatar asked Dec 04 '25 08:12

llamacorn


1 Answers

Building off of my above comment about tagging the branch, did you git push --tags as well? Applying tags is a two step process, and without both, you can get the above error.

enter image description here

like image 120
CodeBender Avatar answered Dec 07 '25 11:12

CodeBender



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!