在传递给“git diff”之前添加某些过滤器

时间:2015-12-13 08:01:27

标签: git diff

在“git diff”中显示的差异之前,是否可以对文件应用某些过滤器,例如“fmt -w 80”?因此,当我想看到差异时,线条会自动断开。

以下是通过fmt -w 20的示例。

原始文件

This is a very very very long line.

修改过的文件

This is a very very very very long line.

定期结果:

-This is a very very very long line.
+This is a very very very very long line.

通过过滤器后:

 This is a very very
-very long line.
+very very long line.

P.S。我知道git diff --color-words可以显示单词的不同,但我只想逐行看到它。

0 个答案:

没有答案