我已经读过相关的 SO 线程here and here,以及 Github 语言学家手动超控,但我似乎无法从语言统计中排除一些顶级目录。
在当前的最新版本中,这个仓库显示了 HTML 代码的优势。单击 HTML 详细信息,会列出两个 HTML 文件:
但这些应该是排除路径的一部分.gitattributes
:
.nuget/* linguist-vendored
libs/* linguist-vendored
NUnit.Runners.2.6.4/* linguist-vendored
packages/* linguist-vendored §§ <--- this one in particular
RubyInstallationFiles/* linguist-vendored
但在同一个详情页中,左下角的排名明显显示 HTML 位于较低位置,而 C# 位于顶部:
![enter image description here](https://i.stack.imgur.com/Os1hd.png)
我究竟做错了什么?
附带问题:在众多更改中,我还删除了 .gitattribute 文件中的注释,因为我无法从任何参考中找到这些注释是否允许或什么。有谁知道可以在里面发表意见吗?哪种格式? TA
您可以使用以下命令检查属性git-check-attr并验证它们是否按照您认为的方式设置。
$ git check-attr --all -- packages/NUnit.2.5.7.10213/NUnitFitTests.html
$
好像没有属性。问题似乎是这样的packages/*
不是递归的。
$ git check-attr --all -- packages/NUnit.2.5.7.10213/
packages/NUnit.2.5.7.10213/: linguist-vendored: set
那么模式的规则是什么?与对于相同吉蒂诺尔.
模式匹配路径的规则与 .gitignore 文件中的相同;请参阅 gitignore(5)。与 .gitignore 不同,禁止使用负模式。
您正在寻找的是/**
.
结尾的“/**”匹配里面的所有内容。例如,“abc/**”匹配目录“abc”内的所有文件,相对于 .gitignore 文件的位置,具有无限深度。
将该修复放入...
$ cat .gitattributes
.nuget/** linguist-vendored
libs/** linguist-vendored
NUnit.Runners.2.6.4/** linguist-vendored
packages/** linguist-vendored
RubyInstallationFiles/** linguist-vendored
现在我们很好。
$ git check-attr --all packages/NUnit.2.5.7.10213/NUnitFitTests.html
packages/NUnit.2.5.7.10213/NUnitFitTests.html: linguist-vendored: set
这也回答了你关于评论的问题......
以 # 开头的行用作注释。对于以哈希开头的模式,在第一个哈希前面放置一个反斜杠(“\”)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)