Git - some files are marked as changed but 'git diff' doesn't show anything

前端 未结 6 700
广开言路
广开言路 2021-02-02 07:11

I am quite new to Git, thus maybe I am missing something here.

dan@one:/var/www/$ git status -s
M  GoogleChromeExtension.js
M  ApiClient.js

So

6条回答
  •  故里飘歌
    2021-02-02 07:43

    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 which compares working directory and commit. So doing git diff HEAD will also give you the diff that you want as well.

提交回复
热议问题