What is the difference between git diff HEAD vs. git diff --staged?

前端 未结 5 675
予麋鹿
予麋鹿 2021-01-29 19:18

What is the difference between git diff HEAD and git diff --staged? I tried both but both give the same output.

5条回答
  •  遥遥无期
    2021-01-29 19:48

    You can also get different output from the two diff commands if you are running them on an unsuccessful merge, i.e. unmerged paths.

    I have not been able to find out why it behaves like this, but you could read more about it here

提交回复
热议问题