我一直在按照这里的指南来比较微软Word文档,但是我遇到了这个错误:
解释一下我是如何犯这个错误的:我在我想要进行差异比较的代码库中创建了一个.gitattributes文件。.gitattributes文件的内容如下:
我已经安装了docx2txt。我使用的是Linux系统。我创建了一个名为
我使用命令
我执行了以下操作:
然后我尝试对比两个Microsoft Word文档。就是在那时我遇到了上面提到的错误。
我错过了什么?我该如何解决这个错误?
附注:我不知道我的shell是否能找到docx2txt,因为当我执行这个操作时:
我的终端卡住了,正在处理某些东西,但没有输出任何内容,当我执行这些命令时就会发生这种情况:
进展更新:我将docx2txt更改为
正如pmod建议的那样,现在可以通过命令行使用
不过,当我尝试时,
Git启动kdiff3时,我遇到了这个弹出错误:
...而且文件中的所有字符都是胡言乱语。命令行正确显示了差异文本,但是由于某种原因,kdiff3无法正确显示差异文本。
我应该如何在kdiff3或其他GUI工具中正确显示差异文本?我应该将kdiff3更换为其他工具吗?
额外信息:我的shell似乎无法找到docx2txt,可能是因为这些命令:
Usage: /usr/bin/docx2txt.pl [infile.docx|-|-h] [outfile.txt|-]
/usr/bin/docx2txt.pl < infile.docx
/usr/bin/docx2txt.pl < infile.docx > outfile.txt
In second usage, output is dumped on STDOUT.
Use '-h' as the first argument to get this usage information.
Use '-' as the infile name to read the docx file from STDIN.
Use '-' as the outfile name to dump the text on STDOUT.
Output is saved in infile.txt if second argument is omitted.
Note: infile.docx can also be a directory name holding the unzipped content
of concerned .docx file.
fatal: unable to read files to diff
解释一下我是如何犯这个错误的:我在我想要进行差异比较的代码库中创建了一个.gitattributes文件。.gitattributes文件的内容如下:
*.docx diff=word
*.docx difftool=word
我已经安装了docx2txt。我使用的是Linux系统。我创建了一个名为
docx2txt
的文件,其中包含以下内容:#!/bin/bash
docx2txt.pl $1 -
我使用命令
$ chmod a+x
给docx2txt添加了可执行权限,并将docx2txt放在了/usr/bin/
目录下。我执行了以下操作:
$ git config diff.word.textconv docx2txt
然后我尝试对比两个Microsoft Word文档。就是在那时我遇到了上面提到的错误。
我错过了什么?我该如何解决这个错误?
附注:我不知道我的shell是否能找到docx2txt,因为当我执行这个操作时:
$ docx2txt
我的终端卡住了,正在处理某些东西,但没有输出任何内容,当我执行这些命令时就会发生这种情况:
$ man docx2txt
No manual entry for docx2txt
$ docx2txt --help
Can't read docx file <--help>!
进展更新:我将docx2txt更改为
#!/bin/bash
docx2txt.pl "$1" -
正如pmod建议的那样,现在可以通过命令行使用
git diff <commit>
命令了!太棒了!不过,当我尝试时,
$ git difftool <commit>
Git启动kdiff3时,我遇到了这个弹出错误:
Some input characters could not be converted to valid unicode.
You might be using the wrong codec. (e.g. UTF-8 for non UTF-8 files).
Don't save the result if unsure. Continue at your own risk.
Affected input files are in A, B.
...而且文件中的所有字符都是胡言乱语。命令行正确显示了差异文本,但是由于某种原因,kdiff3无法正确显示差异文本。
我应该如何在kdiff3或其他GUI工具中正确显示差异文本?我应该将kdiff3更换为其他工具吗?
额外信息:我的shell似乎无法找到docx2txt,可能是因为这些命令:
$ which doctxt
which: no doctxt in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
$ which docx2txt
/usr/bin/docx2txt