I quote a git tutorial:
git diff shows the diff between HEAD and the current project state
I wonder what that means. Isn’t the HEAD the current active project?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From “Specifying revisions“
There are other heads (
FETCH_HEAD,ORIG_HEADandMERGE_HEAD). See Jefromi’s answer for more.The thing is, by default
git diffactually shows the differences between “the current state of your project” (i.e. your files on your working tree) and the index (not HEAD).In other words, the differences are what you could tell git to further add to the index but you still haven’t.
if you do
git diff --cached, then it will compare the index with HEAD.See git book for more (archive link):
See also 365git: Getting a diff between the working tree and other commits: