我已经阅读了相关的 SO 线程 here和 here ,以及 Github 语言学家 manual override ,但我似乎无法从语言统计中排除一些顶级目录。
在当前的最新版本中,this repo显示了 HTML 代码的优势。单击 HTML 详细信息,会列出两个 HTML 文件:
最后索引于 2016 年 12 月 30 日。
最后索引于 2016 年 12 月 30 日。
但那些应该是
.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# 则位于顶部:
我究竟做错了什么?
附带问题:在众多更改中,我还删除了 .gitattribute 文件中的注释,因为我无法从任何引用中找到这些注释是否允许或什么。有谁知道你是否可以在那里发表评论?哪种格式?助教
最佳答案
您可以使用 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 相同.
The rules how the pattern matches paths are the same as in .gitignore files; see gitignore(5). Unlike .gitignore, negative patterns are forbidden.
您要找的是
/**
.A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.
把那个修复...
$ 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
这也回答了你关于评论的问题......
A line starting with # serves as a comment. Put a backslash ("\") in front of the first hash for patterns that begin with a hash.
关于github - Github 语言统计中未排除的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42544813/