执行man diff
告诉如下:人DIFF不对应差异版本安装
NAME
diff - compare files line by line
SYNOPSIS
diff [OPTION]... FILES
DESCRIPTION
Compare files line by line.
-i --ignore-case
Ignore case differences in file contents.
[...]
-q --brief
Output only whether files differ.
[...]
,但是当我使用-q
选项,它失败fatal: invalid diff option/value: -q
为什么diff命令的人不对应安装的版本?
如何解决?
有没有brew版本的diff命令的-q
选项版本? (BREW的coreutils和Binutils没有diff命令)
OSX 10.11.5
更新您的问题
$ which diff
/usr/bin/diff
$ diff --version
usage: git diff --no-index <path> <path>
$ diff -v
usage: git diff --no-index <path> <path>
$ command diff --version
diff (GNU diffutils) 2.8.1
我用BREW和https://github.com/donnemartin/dev-setup
如果我禁用由dev-setup安装的.bash_profile
,然后which diff
仍然返回相同的路径,但diff -q
的作品。
什么是'输出哪个差异? –
问题已被搁置,所以我不能发布答案,但你的'.bash_profile'资源'.functions'和'.functions'确实有函数diff(){git diff --no-index --color - “$ @”; ''。 'git diff'与'diff'略有不同。 –
我看,它使用的是git diff。我不认为这可能是一个git diff的问题,因为我认为它只适用于来自git存储库的文件。好,赶上,thx。有什么我可以做的,以便您可以发布答案,我可以奖励你的? –