title: Applying a diff file with git
body: <p>So I was trying to use apply a diff file to my git dev branch. The diff I wanted to apply was this one here: <a href="https://github.com/mbabker/joomla-cms/compare/JHtml_move.patch">https://github.com/mbabker/joomla-cms/compare/JHtml_move.patch</a></p>
  
  <p>I used <code>git apply PATH_TO_PATCH.patch</code></p>
  
  <p>Now on trying to apply it I get a load of errors cumulating with a </p>
  
  <pre><code>fatal: git apply: bad git-diff - expected /dev/null on line 47
  </code></pre>
  
  <p>Thing is line 47 reads <code>--- /dev/null</code></p>
  
  <p>I saw on another forum somebody say there was a trailing white space after the <code>/dev/null</code> part but there isn't.</p>
  
  <p>In case its any help I'm also being thrown errors of trailing white spaces on lines 9, 10, 11, 12 and 13 - despite their NOT being any trailing white spaces.</p>
  
  <p>In any case the diff is being generated by git - I'm just copying and pasting it into notepad.</p>
  
  <p>I've also tried using <code>curl https://github.com/mbabker/joomla-cms/compare/JHtml_move.patch | git am</code> but that just gives an error without specifying location.</p>
  
  <p><img src="https://i.stack.imgur.com/vdQYP.png" alt="Error message from curl attempt"></p>
  
  <p>Any ideas as to why its giving an fatal error when the line actually exists????</p>
  
  <hr>
  
  <p><strong>Update to @IvanZuzak</strong>
  I tried adding in the <code>git am --ignore-space-change --ignore-whitespace PATH_TO_PATCH.patch</code> however I got first of all (as this was the downloaded patch) an error saying the email was invalid (it had been converted to html code) so I tried to fix that but it kept throwing it up every now and again. Then it said <code>previous rebase directory PATH_TO_GITHUB_BRANCH/.git/rebase-apply still exists but mbox given.</code>. So I found <a href="http://lilypond.1069038.n5.nabble.com/git-help-previous-rebase-directory-td104464.html">this</a> which suggested removing the rebase-apply folder in the branches .git folder. So I did that and then I got the invalid email error again (despite I'd changed both ones away from the html formatted)</p>