Is it possible to format the output of git diff so I'll get only the actual text difference?
for example, this is the default git diff output:
diff --git a/diff_test.txt b/diff_test.txt
index 6b0c6cf..b37e70a 100644
--- a/diff_test.txt
+++ b/diff_test.txt
@@ -1 +1 @@
-this is a git diff test example
+this is a diff example
Instead I want to get:
diff --git a/diff_test.txt b/diff_test.txt
-this is a git diff test example
+this is a diff example
is it possible with git diff or other git command without using other scripts like shell, python ,etc?
Excluding a diff patch header involves generally shell commands (tail/sed)
You can only limit the context to only the modified line, but anything more, like hiding/remove the hunk headers, as in this answer, will involve some "non-git" command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With