skip to content
Alvin Lucillo

Show change summary and full diff

/ 2 min read

git log -p --stat shows both a summary and the full diff for each commit. The --stat part shows which files changed and how many lines were added or removed. The -p part shows the actual patch, meaning the exact lines that changed.

In the output below, each commit first shows the usual commit information, then the file summary, then the full diff.

To show the summary and full diff for each commit, use git log -p --stat. --stat shows the files that are changed with lines that are added/removed. -p shows the exact lines that changed (i.e., the patch)

$ git log -p --stat
commit bfdb0a5890c90f514d272631a25b3c66d7bba4e1
Author: <redacted>
Date: <redacted>

    add version 3
---
 notes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/notes b/notes
index 1f7a7a4..7170a52 100644
--- a/notes
+++ b/notes
@@ -1 +1 @@
-version 2
+version 3

commit c3f49dcc557ca878e073eb9089c8cb22339b00b9
Author: <redacted>
Date: <redacted>

    modify notes and add version
---
 notes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/notes b/notes
index 83baae6..1f7a7a4 100644
--- a/notes
+++ b/notes
@@ -1 +1 @@
-version 1
+version 2

commit 1d96512da874be9b1827c2dccb2d336255667cdf
Author: <redacted>
Date: <redacted>

    add notes and metadata
---
 extra    | 1 +
 metadata | 1 +
 notes    | 1 +
 3 files changed, 3 insertions(+)

diff --git a/extra b/extra
new file mode 100644
index 0000000..e32092a
--- /dev/null
+++ b/extra
@@ -0,0 +1 @@
+version 1
\ No newline at end of file
diff --git a/metadata b/metadata
new file mode 100644
index 0000000..83baae6
--- /dev/null
+++ b/metadata
@@ -0,0 +1 @@
+version 1
diff --git a/notes b/notes
new file mode 100644
index 0000000..83baae6
--- /dev/null
+++ b/notes
@@ -0,0 +1 @@
+version 1