Git diff man page says
Show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, changes between two blob objects, or changes between two files on disk.
I am little confused here for the untracked files in relation to bold part of the definition. Here is what I did
touch test.html
git status
' it shows
blr-mpjfs:workflow_manager amazumde$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
test.html
but when I do git diff
nothing shows up here
If I add the file using git add
git diff shows the difference
I took a look at Can I use git diff on untracked files? Still not sure.
So here is my question "Does git diff show difference between working tree and index for untracked/ newly created files in working directory"?
EDIT
If it is not supposed to show the diff for untracked files, isn't the description little unclear? Is there any place where it is clearly called out?
Second Edit
Also how differently then git status internally works than git diff to show untracked files ?