GitHub changes repository to the wrong language

I found the simplest thing was to create a file called .gitattributes in the root folder of my repository, and give it these contents:

* linguist-vendored
*.js linguist-vendored=false

This example tells GitHub/Linguist to ignore all files, and then just look at .js files. My project, https://github.com/aim12340/jQuery-Before-Ready, was listed as HTML because the HTML example files were bigger than the JavaScript files. This file fixes it for me and now it’s listed as JavaScript.

Leave a Comment