title: How can I apply a TortoiseSVN generated patch to a git repository in Windows?
body: <p>I was working on a project that was in subversion, but then it got migrated to git before I managed to commit the latest changes. I created a patch file using TortoiseSVN, but now I don't know how to apply it. I tried using <code>git apply</code> but it didn't work:</p>
  
  <pre><code>C:\Users\ga1009\Documents\quantlib&gt;git apply ..\dev\Oasis\CatBond_QuantLib_wXL.p
  atch
  ..\dev\Oasis\CatBond_QuantLib_wXL.patch:6: trailing whitespace.
  /* This file is automatically generated; do not edit.     */
  ..\dev\Oasis\CatBond_QuantLib_wXL.patch:7: trailing whitespace.
  /* Add the files to be included into Makefile.am instead. */
  ..\dev\Oasis\CatBond_QuantLib_wXL.patch:8: trailing whitespace.
  
  ..\dev\Oasis\CatBond_QuantLib_wXL.patch:9: trailing whitespace.
  #include &lt;ql/experimental/catbonds/catbond.hpp&gt;
  ..\dev\Oasis\CatBond_QuantLib_wXL.patch:10: trailing whitespace.
  #include &lt;ql/experimental/catbonds/catrisk.hpp&gt;
  error: QuantLib_vc10.vcxproj: No such file or directory
  error: QuantLib_vc10.vcxproj.filters: No such file or directory
  error: test-suite/quantlibtestsuite.cpp: No such file or directory
  error: test-suite/testsuite_vc10.vcxproj: No such file or directory
  error: test-suite/testsuite_vc10.vcxproj.filters: No such file or directory
  error: gensrc/config/categories.xml: No such file or directory
  error: gensrc/metadata/types/types.xml: No such file or directory
  error: QuantLibObjects_vc10.vcxproj: No such file or directory
  error: QuantLibObjects_vc10.vcxproj.filters: No such file or directory
  error: qlxl/QuantLibXLStatic_vc10.vcxproj: No such file or directory
  error: qlxl/QuantLibXLStatic_vc10.vcxproj.filters: No such file or directory
  </code></pre>
  
  <p>These errors are a bit weird, because all of these files should be prefixed by another directory, e.g. from the patch file:</p>
  
  <pre><code>--- QuantLib/QuantLib_vc10.vcxproj  (revision 18468)
  +++ QuantLib/QuantLib_vc10.vcxproj  (working copy)
  </code></pre>
  
  <p>I also tried using TortoiseMerge as suggested in <a href="https://stackoverflow.com/a/5415912/5363">https://stackoverflow.com/a/5415912/5363</a>, but this tool complained about the target folder not being a repository (it is obviously not a svn repository)</p>
  
  <p>EDIT: the <code>patch.exe</code> from gnuwin32 project complains about the same files. Is the patch file wrong in some way? The entry for the first file with errors is:</p>
  
  <pre><code>Index: QuantLib/QuantLib_vc10.vcxproj
  ===================================================================
  --- QuantLib/QuantLib_vc10.vcxproj  (revision 18468)
  +++ QuantLib/QuantLib_vc10.vcxproj  (working copy)
  @@ -250,6 +250,11 @@
     &lt;ItemGroup&gt;
       &lt;ClInclude Include="ql\cashflows\cpicoupon.hpp" /&gt;
       &lt;ClInclude Include="ql\cashflows\cpicouponpricer.hpp" /&gt;
  +    &lt;ClInclude Include="ql\experimental\catbonds\all.hpp" /&gt;
  +    &lt;ClInclude Include="ql\experimental\catbonds\catbond.hpp" /&gt;
  +    &lt;ClInclude Include="ql\experimental\catbonds\catrisk.hpp" /&gt;
  +    &lt;ClInclude Include="ql\experimental\catbonds\montecarlocatbondengine.hpp" /&gt;
  +    &lt;ClInclude Include="ql\experimental\catbonds\riskynotional.hpp" /&gt;
       &lt;ClInclude Include="ql\experimental\finitedifferences\dynprogvppintrinsicvalueengine.hpp" /&gt;
       &lt;ClInclude Include="ql\experimental\finitedifferences\fdextoujumpvanillaengine.hpp" /&gt;
       &lt;ClInclude Include="ql\experimental\finitedifferences\fdklugeextouspreadengine.hpp" /&gt;
  @@ -1375,6 +1380,10 @@
     &lt;ItemGroup&gt;
       &lt;ClCompile Include="ql\cashflows\cpicoupon.cpp" /&gt;
       &lt;ClCompile Include="ql\cashflows\cpicouponpricer.cpp" /&gt;
  +    &lt;ClCompile Include="ql\experimental\catbonds\catbond.cpp" /&gt;
  +    &lt;ClCompile Include="ql\experimental\catbonds\catrisk.cpp" /&gt;
  +    &lt;ClCompile Include="ql\experimental\catbonds\montecarlocatbondengine.cpp" /&gt;
  +    &lt;ClCompile Include="ql\experimental\catbonds\riskynotional.cpp" /&gt;
       &lt;ClCompile Include="ql\experimental\finitedifferences\dynprogvppintrinsicvalueengine.cpp" /&gt;
       &lt;ClCompile Include="ql\experimental\finitedifferences\fdextoujumpvanillaengine.cpp" /&gt;
       &lt;ClCompile Include="ql\experimental\finitedifferences\fdklugeextouspreadengine.cpp" /&gt;
  </code></pre>