问题描述
我试图从一个Git diff中排除一个文件( db / irrelevant.php
)。我曾尝试将 db
子目录(称为 .gitattributes
)与行放在一起无关紧要。 php -diff
我也尝试创建一个名为 .git / info / attributes
的文件,其中包含 db /irrelevant.php
。
在所有情况下, db / irrelevant.php
文件作为Git二进制补丁包含在diff中。我想要的是该文件的更改被diff命令忽略。我在做什么错了?
Omg,驱动程序和awk排除糟糕的文件?由于,您可以:
git diff - 。 ':(排除)db / irrelevant.php'
啊,优雅!请参阅引用的答案,了解详情 by @torek
I am trying to exclude a file (db/irrelevant.php
) from a Git diff. I have tried putting a file in the db
subdirectory called .gitattributes
with the line irrelevant.php -diff
and I have also tried creating a file called .git/info/attributes
containing db/irrelevant.php
.
In all cases, the db/irrelevant.php
file is included in the diff as a Git binary patch. What I want is for the changes to that file to be ignore by the diff command. What am I doing wrong?
Omg, drivers and awk to exclude a lousy file ? Since git 1.9 something you can:
git diff -- . ':(exclude)db/irrelevant.php'
Ah, elegance! See the quoted answer and for details this answer by @torek
这篇关于想要从“git diff”中排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!