title: Git merge subtrees of two local branches
body: <p>For the life of me I can't get <code>git subtree merge</code> to work. Here's my situation:</p>
  
  <p>I'm working on a built-in part of <a href="http://moodle.org" rel="nofollow">Moodle</a> called Workshop. The code lives at <code>mod/workshop</code> in the <code>moodle</code> directory. I have to upgrade my local Moodle to 2.5 and get my Workshop changes to work in it. So, the obvious solution to me is:</p>
  
  <ol>
  <li>Checkout the <code>MOODLE_25_STABLE</code> branch from the upstream</li>
  <li>Create a branch called <code>MOODLE_25_STABLE_workshop</code> based on that branch</li>
  <li>Merge <code>mod/workshop</code> from my <code>MOODLE_23_STABLE_workshop</code> branch into <code>MOODLE_25_STABLE_workshop</code></li>
  </ol>
  
  <p>That would be <em>easy</em> if I wanted to merge every single file from <code>MOODLE_23_STABLE_workshop</code> into <code>MOODLE_25_STABLE_workshop</code> but I'm only interested in replaying my commits to the <code>mod/workshop</code> directory. Is there an easier way than to <code>cherry-pick</code> my way through six months of commits? Because I really, really don't want to do that.</p>
  
  <p>Things I have already tried:</p>
  
  <pre><code>$ git subtree merge --prefix=mod/workshop/ MOODLE_23_STABLE_workshop:mod/workshop
  error: 402c67f6fedc96a6fed76e663df4e5af9dfa094e: expected commit type, but the object dereferences to tree type
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$ git merge -s ours --no-commit MOODLE_23_STABLE_workshop
  $ git read-tree --prefix=mod/workshop/ -u MOODLE_23_STABLE_workshop:mod/workshop
  error: Entry 'mod/workshop/aggregate.php' overlaps with 'mod/workshop/aggregate.php'.  Cannot bind.
  $ gormster:Documents/moodle$ git read-tree -m --prefix=mod/workshop/ -u MOODLE_23_STABLE_workshop:mod/workshop
  fatal: Which one? -m, --reset, or --prefix?
  </code></pre>
  
  <p>Any guidance is appreciated.</p>