首页 > 解决方案 > git diff 忽略移动

问题描述

我需要区分两个删除所有空白和代码移动的提交。所以当我使用:

git diff --stat COMMIT1 COMMIT2

我得到:67 files changed, 3615 insertions(+), 5534 deletions(-)

当我使用时:

git diff --stat --ignore-space-at-eol -b -w --ignore-blank-lines COMMIT1 COMMIT2

我明白了67 files changed, 885 insertions(+), 2655 deletions(-)

这仍然是移动代码的原因,当我传递--color-movedgit diff命令时,它会正确检测移动并用不同的颜色 ( zebra) 标记它们。

我的问题:有没有办法忽略使用的动作,git diff以便我可以利用--statof git diff?像--ignore-moved什么?

标签: gitdiff

解决方案


推荐阅读