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)
    modified:   README.md

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

See git diff to learn more about it.

Last modified on November 30, 2021.

You might also like