你是否可以格式化git diff的输出,以便只获取实际的文本差异?
例如,默认的git diff输出如下所示:
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
相反,我想要获得:
diff --git a/diff_test.txt b/diff_test.txt
-this is a git diff test example
+this is a diff example
是否可能使用git diff或其他git命令而不使用其他脚本,如shell、python等?