How to ignore specific directory for language stats in GitHub?
Asked Answered
L

1

4

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 :)

Lacuna answered 26/7, 2023 at 20:8 Comment(2)
Depending on what the directory tree in budget looks like, maybe budget/** linuguist-vendored?Carisa
Yup this did the trick, thanks! Had a bunch of subfolders under budget.Lacuna
E
6

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).

Essayist answered 28/9, 2023 at 10:29 Comment(1)
In my case, I didnt have a folder to exclude but a folder to specify. My folder was called 'demo' so what worked for me was : demo/** linguist-vendored=false anddemo/** linguist-documentation=falseGet

© 2022 - 2024 — McMap. All rights reserved.