title: How to use diff and patch in Cygwin on Windows?
body: <p>I follow many articles out there but I still don't know how to use diff and patch in Cygwin</p>
  
  <p>Here I create 2 files in Windows Explorer</p>
  
  <p><strong>origin.txt</strong></p>
  
  <pre><code>one
  two
  three
  </code></pre>
  
  <p><strong>new.txt</strong></p>
  
  <pre><code>one
  four
  five
  </code></pre>
  
  <p>Then I <code>diff -u origin.txt new.txt &gt; file.patch</code> which results this</p>
  
  <pre><code>--- origin.txt  2013-03-21 15:53:20.062956800 +0700
  +++ new.txt 2013-03-21 15:53:29.191869600 +0700
  @@ -1,3 +1,3 @@
   one
  -two
  -three
  \ No newline at end of file
  +four
  +five
  \ No newline at end of file
  </code></pre>
  
  <p>Then I <code>patch origin.txt &lt; file.patch</code> which show errors</p>
  
  <pre><code>patching file origin.txt
  Hunk #1 FAILED at 1.
  1 out of 1 hunk FAILED -- saving rejects to file origin.txt.rej
  </code></pre>
  
  <p>How to overcome this? Is this related to Unix and Windows file format?</p>
  
  <p><strong>P/S</strong>: I'm using CYGWIN_NT-6.1-WOW64 and Windows 7 64bit</p>