How to show the changes in the last commit?

git show HEAD

To show the changes in the last commit use git show HEAD.

Layer 1
Terminal Example
git show HEAD
commit 8cbc93b1adae11bd9d6e9c1d0f02fac945bb358f (HEAD -> main)
Author: Tom Ato
Date:   Thu Jun 3 16:45:52 2021 +0200

    Bye function

diff --git a/code.rb b/code.rb
index 82509d3..39a11a1 100644
--- a/code.rb
+++ b/code.rb
@@ -1,3 +1,3 @@
-def say_hello(name)
-  "Hello, #{name}"
+def say_bye(name)
+  "Bye, #{name}"
 end

See git show to learn more about it.

Last modified on November 30, 2021.

You might also like