Please, observe (I am using posh-git):
C:\xyz\git [master ↑2 +27 ~0 -0 !]> git diff --name-only
C:\xyz\git [master ↑2 +27 ~0 -0 !]>
27 folders are unstaged, each has some files. No changes are staged.
Why does not it show any files?
EDIT 1
The following simple transcript demonstrates the problem:
C:\xyz> mkdir git
Directory: C:\xyz
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/16/2018 1:20 PM git
C:\xyz> cd git
C:\xyz\git> git init
Initialized empty Git repository in C:/xyz/git/.git/
C:\xyz\git [master]> echo hello > 1.txt
C:\xyz\git [master +1 ~0 -0 !]> git diff --name-only
C:\xyz\git [master +1 ~0 -0 !]> git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
1.txt
nothing added to commit but untracked files present (use "git add" to track)
C:\xyz\git [master +1 ~0 -0 !]>
EDIT 2
According to https://git-scm.com/docs/git-diff :
git diff [<options>] [--] [<path>…]
This form is to view the changes you made relative to the index (staging area for the next commit). In other words, the differences are what you could tell Git to further add to the index but you still haven’t. You can stage these changes by using git-add[1].
As far as I understand it means the git diff --name-only
command in the transcript above should list 1.txt