Git - some files are marked as changed but 'git diff' doesn't show anything
Do a git diff --cached
- it compares the HEAD and index, ie stuff added for commit.
Just a git diff
is between index and working directory, so if all the changes have been staged for commit, you won' see anything in git diff
The third form is git diff <commit>
which compares working directory and commit. So doing git diff HEAD
will also give you the diff that you want as well.
Depending on exactly what is going on, there may be two solutions to this. It would be best if you didn't use short mode since it hides information important for debugging this.
If you expect changes, try running git diff HEAD
to compare the working directory to the last commit. If you have already git add
ed the changes, the default git diff action will be to not show those differences. See the http://git-scm.com/docs/git-diff man page DESCRIPTION which talks about this. The git status
output (without -s) would help everyone see whether this was the case.
Alternately, if you didn't expect changes, this could be an OS/filesystem problem. Please report your OS and filesystem information.
Make sure that you're not actually within another git repository. And if for some reason above commands fails, try to run:
git show HEAD