How to see changes to be commited?

git diff --cached

To see changes to be commited use git diff --cached. The command shows your changes in the staging area, which will be part of the next commit.

Layer 1
Terminal Example
git status
On branch main
Changes to be committed:
  (use "git restore --staged ..." to unstage)

git diff --cached
diff --git a/ b/
index 980a0d5..0fb6087 100644
--- a/
+++ b/
@@ -1 +1 @@
-Hello World!
+Hello World, welcome to!

See git diff to learn more about it.

Last modified on November 30, 2021.

You might also like