To see what you’ve changed but not yet staged, type git diff
with no other argumentsgit
That command compares what is in your working directory with what is in your staging area. The result tells you the changes you’ve made that you haven’t yet staged.this
If you want to see what you’ve staged that will go into your next commit, you can use git diff --staged
. This command compares your staged changes to your last commit:code
It’s important to note that git diff
by itself doesn’t show all changes made since your last commit – only changes that are still unstaged. This can be confusing, because if you’ve staged all of your changes, git diff
will give you no output.it
For another example, if you stage the CONTRIBUTING.md
file and then edit it, you can usegit diff
to see the changes in the file that are staged and the changes that are unstaged. If our environment looks like this:ast
git commi -v import
git commit file
git commit -mcommand