title: Getting the latest code of a CocoaPods dependency that points to a branch
body: <p>This question is about how to get the latest code for CocoaPods-managed dependencies during development, i.e. without doing the whole "push a new podspec" dance.</p>
  
  <h3>Setup</h3>
  
  <p>Say we have three projects <code>A</code>, <code>B</code>, and <code>C</code>. The dependencies are such that <code>A</code> depends on <code>B</code>, and <code>B</code> depends on <code>C</code>. Each project resides in its own Git repository.</p>
  
  <p>We figured we'd use a dummy minor version to identify the current state of the code. The podspecs reside in our own repository.</p>
  
  <pre><code># A/Podfile
  ...
  pod 'B', '1.dev'
  
  # B/Podfile
  ...
  pod 'C', '1.dev'
  
  # B/B.podspec
  Pod::Spec.new do |s|
      s.name = 'B'
      s.version = '1.dev'
      ...
      s.dependency = 'C', '1.dev'
  end
  
  # C/C.podspec
  Pod::Spec.new do |s|
      s.name = 'C'
      s.version = '1.dev'
      ...
  end
  </code></pre>
  
  <h3>The Problem</h3>
  
  <p>We push a new commit to (the master branch of) <code>C</code>. We expect </p>
  
  <pre><code>A$ pod update
  </code></pre>
  
  <p>to retrieve the change. This does not happen.</p>
  
  <h3>Approaches</h3>
  
  <ol>
  <li><p>Whenever we (know to) want to pull the dependencies anew, do:</p>
  
  <pre><code>A$ rm -rf Pods/ Podfile.lock
  A$ pod cache clean --all
  A$ pod install
  </code></pre>
  
  <p>This definitely gets the latest code. However, it's a sledgehammer that's neither convenient nor efficient to do after every pull in <code>A</code>,  push in either <code>B</code> or <code>C</code>, or switching between branches in <code>A</code>. </p></li>
  <li><p>In order to stick close to the setup, we'd have to create a whole new set of podspecs and Podfiles after every (meaningful) set of commits on a master branch (i.e. a merge of a feature branch), all with a new version <code>1.x-y</code> (<code>y</code> a build number or something); push the podspecs; and run <code>pod update</code> in <code>A</code> and <code>B</code>.</p>
  
  <p>While this may be feasible in a CI setup (which we unfortunately don't have, yet), it's prohibitive work to do manually. Git hooks may be a workaround.</p></li>
  <li><p>On non-version branches, do</p>
  
  <pre><code># A/Podfile
  ... 
  pod 'A', :git =&gt; "...", :branch =&gt; "master"
  </code></pre>
  
  <p>That is, circumvent the podspec repo. Unfortunately, this won't work here becaus <code>pod</code> will inspect <code>B.podspec</code> and find its dependency <code>C</code>, which we can not specify in a similar way. Also, <code>pod update</code> always re-installs, no matter if there were new commits.</p></li>
  </ol>
  
  <h3>Question</h3>
  
  <p>Is there a good (low maintenance) way to track branches with CocoaPods? If not, what are alternatives?</p>