在合并输出中显示提交之间的差异

当将一个分支合并到另一个分支时,如何获得以输出格式显示的分支之间的区别?例:

$ git merge random
Updating eb79f04..645485f
Fast-forward
 simple.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

EDIT1: I can get a similar result with something like git diff 0931ab1...eb79f04 --name-only but that does not display the degree of change.

评论
  • A书白
    A书白 回复

    The --stat flag can do that.

    git diff --stat <branch1> <branch2>
    

    Alternatively, if you only need the 1 file changed, 1 insertion(+), 1 deletion(-) line, use --shortstat instead.