How do I see changes in the git index?
Say I do
git add foo.txt
Now, foo’s changes are in the index (I’m assuming git was already tracking that file). Now, when I do git diff, I can’t see the changes in foo by doing
Are there some extra things that
git diff wants before it shows me those changes?
One Solution collect form web for “How do I see changes in the git index?”
git diff shows unstaged changes. To get the staged/cached changes, you can do
git diff --cached. To get both cached and uncached changes, you can do
git diff HEAD, which compares the whole working tree to the named commit (HEAD).