title: Error while applying a patch in git
body: <p>I have a shallow clone, on which i made three commits.
  Here is the log: <br></p>
  
  <blockquote>
    <p>$ git log --oneline --graph --decorate --all <br>
    * <b>d3456fd (HEAD, master) patch 3 </b><br>
    * <b>9713822 patch 2 </b><br>
    * <b>6f380a6 patch 1 </b><br>
    * 8a1ce1e (origin/master, origin/HEAD) from full clone <br>
    * 7c13416 added from shallow <br>
    * 3b3ed39 removed email <br>
    * cfbed6c further modifications <br>
    * a71254b added for release 2.1 <br>
    * 7347896 (grafted) changes for release 2 <br></p>
  </blockquote>
  
  <p>now i create a patch from here: <br></p>
  
  <blockquote>
    <p>$ git format-patch  -k --stdout origin > ../format_since_origin.patch <br></p>
  </blockquote>
  
  <p>I want to apply this patch in another clone, which is a full clone.<br>
  Here is the log: <br></p>
  
  <blockquote>
    <p>$ git log --oneline --graph --decorate --all <br>
    * 8a1ce1e (HEAD, origin/master, master) from full clone<br>
    * 7c13416 added from shallow<br>
    * 3b3ed39 removed email<br>
    * cfbed6c further modifications<br>
    * a71254b added for release 2.1<br>
    * 7347896 changes for release 2<br>
    * b1a8797 changes to ttwo files<br>
    * 603710c changed test report<br>
    * 16b20b3 added test_report.txt<br>
    * f0871ea modified file1.xml<br>
    * dd94bfc added file1.xml<br>
    * 00758aa second commit<br>
    * 49f9968 first commit<br></p>
  </blockquote>
  
  <p>I am unable to apply the patch created from the shallow clone above. I get the following error. <br></p>
  
  <blockquote>
    <p>$ git am -3 /c/temp/git/format_since_origin.patch<br>
    Applying: patch 1<br>
    Using index info to reconstruct a base tree...<br>
    error: patch failed: file1.c:6<br>
    error: file1.c: patch does not apply<br>
    Did you hand edit your patch?<br>
    It does not apply to blobs recorded in its index.<br>
    Cannot fall back to three-way merge.<br>
    Patch failed at 0001 patch 1<br>
    When you have resolved this problem run "git am --resolved".<br>
    If you would prefer to skip this patch, instead run "git am --skip".<br>
    To restore the original branch and stop patching run "git am --abort".<br></p>
  </blockquote>
  
  <p>Any idea why this patch is failing? Or is my method totally wrong?</p>
  
  <h1>Update:</h1>
  
  <p>It works with the following <br></p>
  
  <blockquote>
    <p>$ git am -3 --ignore-whitespace /c/temp/git/format_since_origin.patch
    Applying: patch 1
    Applying: patch 2
    Applying: patch 3</p>
  </blockquote>
  
  <p>Now, as suggested by Charles - if i try the git diff, i get the error as below.</p>
  
  <blockquote>
    <p>$ git diff -p origin > ../dif_origin.patch <br></p>
  </blockquote>
  
  <p>On applying,</p>
  
  <blockquote>
    <p>$ git apply --ignore-whitespace --inaccurate-eof /c/temp/git/dif_origin.patch<br>
    c:/temp/git/dif_origin.patch:9: trailing whitespace.<br>
    patch change for file1.c<br>
    c:/temp/git/dif_origin.patch:18: trailing whitespace.<br>
    patch this xml guy<br>
    c:/temp/git/dif_origin.patch:29: trailing whitespace.<br>
    fsdfsd<br>
    c:/temp/git/dif_origin.patch:30: trailing whitespace.<br>
    patch this report<br>
    error: patch failed: file1.c:6<br>
    error: file1.c: patch does not apply<br>
    error: patch failed: file1.xml:2<br>
    error: file1.xml: patch does not apply<br>
    error: patch failed: tr/test_report.txt:2<br>
    error: tr/test_report.txt: patch does not apply<br></p>
  </blockquote>