'git diff' doesn't give any output

前端 未结 9 2148
迷失自我
迷失自我 2020-12-08 09:11

If I run git diff I would expect to see a list of changes of my working directory relative to whatever had been committed before (or a list of the working direc

9条回答
  •  感情败类
    2020-12-08 09:56

    Basing on your git status output there is nothing to show for git diff without additional parameters. There is nothing to show for git diff --cached and git diff HEAD as all of these commands rely on changes already known to Git.

    You have no staged files and no changed files from those that are under version control now.

    After you add test.txt under Git control you will get the desired output.

    Just type

    git add test.txt
    

    or

    git add .
    

    Then this file will be added under version control. And future changes of this file will be shown by git diff.

提交回复
热议问题