Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
262 views
in Technique[技术] by (71.8m points)

github - Is it possible to exclude files from git language statistics?

Silly question and not on something that is so necessary, but is it possible to exclude files from git language statistics aggregation on top?

I have checked some external CSS and JavaScript frameworks so that they can be compressed along with the rest of the source code. They get measured as part of the project, but they have not been contributed from a team member so the status bar does not exactly reflect the truth.

question from:https://stackoverflow.com/questions/19052834/is-it-possible-to-exclude-files-from-git-language-statistics

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

GitHub uses the Linguist library for source code detection; Linguist treats all of the paths defined in its' vendor.yml as vendored and won't include them in the language statistics for a repository.

You can specify something different for your repo by editing your repo's .gitattributes file. To treat a path as a vendored file, add the path followed by linguist-vendored:

special-vendored-path/* linguist-vendored

To treat an otherwise vendored path as unvendored, use linguist-vendored=false:

jquery.js linguist-vendored=false

Source


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...