<div dir="ltr"><div><div><div><div><div><div>Hi i have one doubt when creating patch files. if consider a file a.txt it contains <br></div>This<br></div>is<br></div>a<br></div>simple<br></div>file.<br><br></div><div>i added to git and commit it.<br>
</div><div>Next i changed the file as<br></div><div>This<br>is<br></div><div>a<br></div><div>slightly more complex<br></div><div>file.<br><br></div><div>Again i added to git and commit it.<br></div><div>Now if i create a patch by using the below commands<br>
<br></div><div><div><div>git format-patch -n HEAD<br>git show HEAD > somepatch.patch<br><br></div><div>the contents in somepatch.patch are shown below<br><br>commit 0e1d77b66e708580a07530e8c1bf20546a701c6f<br>Author: <UserName> <<a href="mailto:xxxxxxxxx@gmail.com">xxxxxxxxx@gmail.com</a>><br>
Date: Tue Jun 3 22:02:57 2014 +0530<br><br> Next Commit<br><br>diff --git a/a.txt b/a.txt<br>index 76e499a..c341c1c 100644<br>--- a/a.txt<br>+++ b/a.txt<br>@@ -1,5 +1,5 @@<br> this<br> is<br> a<br>-simple <br>+slightly more complex file <br>
file.<br><br><br></div><div>My doubt is how to create patch file which contains the modifications only i.e lines with "+" only why because for example initially if a file contains 1000 rows after i changed 2 lines but in the patch file it is taking entire 1000+2 lines.So is there any way to generate patch with only modified lines?<br>
</div><div>Thank you<br></div></div></div></div>