githubrepositorygitattributesgithub-linguist

How to ignore specific directory for language stats in GitHub?


This is my repo structure:

These are the language stats as detected by GitHub, even though this is a full stack app written primarily in Javascript:

This is because it is reading the budget directory for language stats. How can I get it to ignore the budget folder?

I have tried creating a .gitattributes file in the root folder with the following line: budget/* linguist-vendored, but it's been over a week and I haven't seen a change. I have also tried budget/* linguist-detectable=false.

I would really appreciate some help! Thanks :)


Solution

  • Linguist overrides use standard git-style path matchers, so to match on a directory and all subdirectories and files inside it, you need to use directory/**.

    Attributes linguist-vendored, linguist-detectable, and linguist-documentation would all have the effect you're looking for here (excluding from language statistics).