Solution: Change Linguist Vendor Attribute

Github sometimes marks one repo’s language wrong because of Linguist Library behavior. Here is a quick fix.

  1. First, create file .gitattributes in the root folder of the repository you want to fix.
  2. Write following lines into this file, and stage, commit, push to github.
    * linguist-vendored
    *.cpp linguist-vendored=false
    *.hpp linguist-vendored=false

After doing this, the Linguist now only takes .cpp and .hpp files into consideration for deciding your repo’s language. Change the lines according to which language you want it to recognize.


Leave a Comment