Github changes repository to wrong language

Echizzle picture Echizzle · Jan 11, 2016 · Viewed 59.7k times · Source

I know this isn't a huge deal but I like my Github to be linguistically diversified. I wrote a project in Swift and when I commit it says it's in Objective C.

I think it might be because the Parse frameworks are written in Objective C and it detects that, but is there any way to change the display language on the main repository page?

Answer

EamonnM picture EamonnM · Apr 20, 2017

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, 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 JS files. This file fixes it for me and now it's listed as JavaScript