title: How to apply a git patch from one repository to another?
body: <p>I have two repositories, one is the main repo for a library, and the other is a project using that library.</p>
  
  <p>If I make a fix to the in the subservient project, I'd like an easy way to apply that patch back upstream.</p>
  
  <p>The file's location is different in each repository.</p>
  
  <ul>
  <li>Main repo: <strong><em><code>www.playdar.org/static/playdar.js</code></em></strong></li>
  <li>Project: <strong><em><code>playlick.com/lib/playdar.js</code></em></strong></li>
  </ul>
  
  <p>I tried using <code>git format-patch -- lib/playdar.js</code> on the playlick project, and then <code>git am</code> on the main playdar repo, but the differing file locations in the patch file raised an error.</p>
  
  <p>Is there an easy way to apply the patch from a given commit on a given file to another arbitrary file elsewhere?</p>
  
  <p>For bonus points, what if the file you want to apply the patch to isn't in a git repository?</p>