Reputation: 6709
I have these two git commands
git diff-index --cached --name-status HEAD
and
git diff --cached --name-status
I can't see the difference between them. I've been experimenting with adding and modifying and deleting files on my branch and running these commands but they seem to be giving me the same results.
Upvotes: 1
Views: 75
Reputation: 1326736
Since you don't specify paths to git diff
or git diff-index
, both will by default compare:
--cached
, which does not consider the on-disk file at all)So it seems normal they return the same result.
Upvotes: 1