git format-patch -n HEAD
git show HEAD > somepatch.patch
the contents in somepatch.patch are shown below
commit 0e1d77b66e708580a07530e8c1bf20546a701c6f
Author: <UserName> <
xxxxxxxxx@gmail.com>
Date: Tue Jun 3 22:02:57 2014 +0530
Next Commit
diff --git a/a.txt b/a.txt
index 76e499a..c341c1c 100644
--- a/a.txt
+++ b/a.txt
@@ -1,5 +1,5 @@
this
is
a
-simple
+slightly more complex file
file.
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?
Thank you