如何让git-diff和git log忽略新的和删除的文件? [英] How to make git-diff and git log ignore new and deleted files?

查看:679
本文介绍了如何让git-diff和git log忽略新的和删除的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,有一些更改的文件以及一些新的,删除和/或重命名的文件。当做 git diff git-log 我想省略它们,所以我可以更好地发现修改。实际上,列出没有内容的新文件和已删除文件的名称将是最好的。 对于旧更名为新,我想选择旧和新之间的区别。 - diff-filter 选项适用于 diff 和log。



我使用 - diff-filter = M 很多限制差异输出的内容修改。



要检测重命名和复制并在diff输出中使用它们,可以使用 -M -C 分别与 R C 选项一起添加到 - diff-filter


Sometimes there's a couple of changed files together with some new, deleted and/or renamed files. When doing git diff or git-log I'd like to omit them, so I can better spot the modifications.

Actually, listing the names of the new and deleted files without their content would be best. For "old" renamed to "new" I'd like to optionally get the difference between "old" and "new".

解决方案

The --diff-filter option works with both diff and log.

I use --diff-filter=M a lot which restricts diff outputs to only content modifications.

To detect renames and copies and use these in the diff output, you can use -M and -C respectively, together with the R and C options to --diff-filter.

这篇关于如何让git-diff和git log忽略新的和删除的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆