Git - 导致“警告:git 属性中忽略负面模式”的原因

Git - 导致“警告:git 属性中忽略负面模式”的原因

当在我的服务器上推送时,post-receive钩子运行一个git clone命令。

该命令返回以下警告,我不知道这是什么意思,也不知道该如何解决。谷歌搜索错误只给出了有关 gitattributes 的结果,而我尚未配置任何属性。我的 .gitignore 文件中也没有感叹号或负值。

remote: Cloning into '/var/www/html/gitrep'...        
remote: warning: Negative patterns are ignored in git attributes
remote: Use '\!' for literal leading exclamation.

答案1

通过搜索.gitattributesgit 存储库中的每个文件解决了问题。

其中一个文件有一行以感叹号开头,但未被注释掉,因此导致了此警告。

答案2

在我的特定情况下,我的顶级目录只有几个选择,所以,因为我知道我想有效地排除 a 下的所有文件,并且我只希望扩展发生在 other_dir 下的所有文件上,然后我将模式更改为:

other_dir/**/*.awk      ident
*.c                     ident

我发现这个链接可能会对你有帮助 -

http://www.kehe.tech/questions/3254938/how-to-exclude-files-from-git-id-expansion

相关内容