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

后端 未结 3 666
猫巷女王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:42

    Your file is already staged to be committed. You can show it's diff using the --cached option of git.

    git diff --cached myfile
    

    To unstage it, just do what git status suggests in it's output ;)

    You can check The Git Index For more info.

提交回复
热议问题