Description
In the Tracking Changes episode of the Version Control with Git lesson, git diff
command has been used in two different forms of without any switch and with --staged
switch. The one without switch is introduced as "the differences between the current state of the file and the most recently saved version" and the other one is explained as "the difference between the last committed change and what’s in the staging area.".
Although they may seem fine, they are not accurate (especially the explanation of git diff
). What this command in general does is to give us a report of the difference between various states of our files. Those states could be working directory, staging area, and commit. Thus, to make the above mentioned commands more precise, I suggest to change their definitions to the followings:
-
git diff
: difference between the working directory and the last commit -
git diff --staged
: difference between the staging area and the last commit