Cocoapods和forked repo问题

时间:2014-02-02 21:15:08

标签: github cocoapods git-fork

所以这是我的podfile:

workspace 'WSPhoto.xcworkspace'
platform :ios, :deployment_target => "6.1"

xcodeproj 'WSPhoto'

pod 'Parse-iOS-SDK', '~> 1.2.17'
pod 'REActivityViewController',  :git => 'https://github.com/ramsel/REActivityViewController.git', :commit => 'f027011e8159393cf678d7c67c408891b609a6ef'
pod 'SWTableViewCell', :git => 'https://github.com/ramsel/SWTableViewCell.git', :commit => '6f4e55e554c1b26ff3c850eb331273b536e4f900'
pod 'ELCImagePickerController', '~> 0.2.0'
pod 'ChimpKit'

我正在根据前一个问题中的建议,将Cocoapods指向我的叉子的特定提交:

CocoaPods and GitHub forks

但是,我在pod install --verbose上收到以下错误:

Fetching external sources
-> Pre-downloading: `REActivityViewController` from `https://github.com/ramsel/REActivityViewController.git`, commit `f027011e8159393cf678d7c67c408891b609a6ef`
 > GitHub download
   $ /usr/bin/git config core.bare
   true
   $ /usr/bin/git config core.bare
   true
   $ /usr/bin/git rev-list --max-count=1
   f027011e8159393cf678d7c67c408891b609a6ef
   fatal: bad object f027011e8159393cf678d7c67c408891b609a6ef
   [!] Failed: /usr/bin/git rev-list --max-count=1
   f027011e8159393cf678d7c67c408891b609a6ef
 > Cloning to Pods folder
     $ /usr/bin/git clone
     "/Users/admin/Library/Caches/CocoaPods/GitHub/4a2fb7e9e50f5b0922a251d6b2763
     d6d37629fda"
     "/Users/admin/Dropbox/Apps/things/Pods/REActivityViewController"
     Cloning into '/Users/admin/Dropbox/Apps/things/Pods/REActivityViewController'...
     done.
     Checking connectivity... done
   $ /usr/bin/git checkout -b activated-pod-commit
   f027011e8159393cf678d7c67c408891b609a6ef 2>&1
   fatal: reference is not a tree: f027011e8159393cf678d7c67c408891b609a6ef
[!] Pod::Executable checkout -b activated-pod-commit f027011e8159393cf678d7c67c408891b609a6ef 2>&1

fatal: reference is not a tree: f027011e8159393cf678d7c67c408891b609a6ef

我尝试引用一个不同的REActivityViewController叉,但错误相同。我注释掉了podfile中的REActivityViewController行,并且SWTableViewCell的fork安装得很好。

所以我认为这是我的REActivityViewController分叉特有的东西,但它并不特定于该分支中的特定提交。

1 个答案:

答案 0 :(得分:12)

所以这很有效:

pod 'REActivityViewController',  :git => 'https://github.com/ramsel/REActivityViewController.git', :commit => 'f027011e8159393cf678d7c67c408891b609a6ef',  :branch => 'master'

我只需要添加:

:branch => 'master'