0

I know that GitHub automatically determines a repository's language by looking a the type of files in the repository. It is however supposed to be possible to override this by editing the .gitattributes file in the repository's root, as suggested in GitHub changes repository to the wrong language.

But I'm unable to make this work, and no language is specified for my repository (supposed to be Javascript).

This is my .gitattributes file:

examples/* linguist-vendored
* linguist-vendored
*.js linguist-vendored=false
*.js linguist-detectable=true
*.js linguist-language=JavaScript

My repository is:

https://github.com/arnemorken/anypaginator

Arne M
  • 87
  • 8
  • Does it work if you remove the second line from your `.gitattributes` file? – pchaigno Feb 07 '22 at 20:46
  • @pchaigno No. But if I do that, it sets CSS as the language, so there's something going on there. I have tried many other variations, but no luck. The repository has only one CSS and one (much larger) Javascript file. – Arne M Feb 07 '22 at 21:24
  • Then remove the second line and add `*.css linguist-vendored`. – pchaigno Feb 07 '22 at 22:02
  • @pchaigno Yes, I already tried that, but no cigar. That is, it reverts to showing no language. – Arne M Feb 07 '22 at 22:18
  • Ah, right. Makes sense. Did you try to remove the last line? It shouldn't be needed AFAICT. If that doesn't work, then you're best bet is probably to run `github-linguist --breakdown` against your repository and check the results. – pchaigno Feb 07 '22 at 22:25

0 Answers0