git diff --staged
Displays changes between the index and the last commit.
This command performs a diff
operation to compare the differences between the index (where changes are staged for the next commit) and the last commit in the Git repository. The output shows what modifications have been staged for commit but not yet committed to the repository. This allows you to review your changes before making a commit.
--cached
is a synonym for --staged
.