Is it possible to exclude files from git language statistics?

From the Github Help page My repository is marked as the wrong language:

Linguist excludes certain file names and paths from statistics. Check out the vendor.yml file for a list of these exclusions.

Pull requests with new exclusion patterns are always welcome.

So if your javascsript/css files match a regexp in that Yaml file they shouldn’t be included in the stats. If they don’t, you could add them and create a pull-request.


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.

Update:

From comments below, currrent instructions are here: https://github.com/github/linguist/blob/master/docs/overrides.md

Original answer:

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

Tags:

Github