title: Can I get a patch-compatible output from git-diff?
body: <p>I am doing something very simple wrong.  I'm trying to prepare an ordinary patch file, so I can reapply some changes:</p>
  <pre><code>$ git diff &gt; before
  $ git diff something_here &gt; save.patch
  $ git checkout . 
  $ patch &lt; save.patch
  $ git diff &gt; after
  $ diff before after
  $
  </code></pre>
  <p>With <code>something_here</code> <em>blank</em> it almost works, but the file names aren't right.  I think I'm just I'm missing some option.</p>
  <p>In real life, I am going to do a merge after the checkout, so the patch might fail there, but you see what I'm getting at.</p>
  <p><strong>Edit</strong>
  My fault here for asking the wrong question.  The actual question is, I want to save my changes away, do a merge, then re-apply the changes, if possible?  I asked it the wrong way because I am <em>used</em> to using patch to solve these sorts of problems and <code>git diff</code> looked like that's what it wanted me to do.</p>
  <p>Charles Bailey's <em>comment</em> had the right answer.  For me, git-apply is the right thing to do (git-stash looks more heavy-weight than I need and rebasing and bundles is definitely beyond my current skill level.)  I'm going to accept the answer Charles gave (because you can't accept a comment).  Thanks for all the suggestions.</p>
  <p><strong>Edit, 6 years later</strong>
  As anyone familiar with the subject knows, I over-estimated the difficulty of <code>git stash</code>.  Pretty much every day or so, I will use the following sequence:</p>
  <pre><code>$ git stash
  $ git merge
  $ git stash pop
  </code></pre>
  <p><strong>Edit, 5 years further down the road</strong> I have largely abandoned <code>git apply</code> and don’t even used <code>git stash</code> much.  <code>git rebase</code> FTW.</p>