git: Why doesn't git diff show any differences?

后端 未结 3 664
猫巷女王i
猫巷女王i 2021-02-06 21:03

If I run \'git status\' on my repo it gives:

# On branch master
# Changes to be committed:
#   (use \"git reset HEAD ...\" to unstage)
#
#   modified         


        
3条回答
  •  有刺的猬
    2021-02-06 21:36

    For Staging Area vs Repository comparison use

    $git diff --staged
    

    For Working vs Repository comparison use

    $ git diff 
    

    but if a file is changed and added to staging area ($ git add fileName) and we try to see the difference with ( $ git diff). It will not return any difference since the file is in staging area and it will not be compared with the repository.

提交回复
热议问题