2014-09-12 209 views
0

我想使用textutil将.doc或.docx文件与git diff进行比较。例如:textutil 'Hello.doc' -convert txt -stdout。但我无法弄清楚如何在不带新参数的情况下使用参数将其放入配置文件中。我也试过using catdoc,但意识到它不适用于.docx。想法?Git diff with textutil

回答

0

您是否尝试了Git帮助页面中“定义外部差异驱动程序”中的说明?

在git属性中,您将指定doc和docx的类型,并在git config中指定您的转换过程。喜欢的东西(我没有遗憾的是测试这种方式)

属性

*.docx diff=docxdiff 

配置

[diff "docxdiff"] 
    command = textutil -convert txt -stdout 

Git attributes