Github-modify language statistics

Source: Internet
Author: User

Github-modify language statistics

Some people mentioned this problem some days ago, so I tried to solve it myself. I will record it here and hope to help you.

After a repository is created in Github, a color bar indicating the language used for statistics will appear.
This is the following:

 

It seems that many people have encountered this problem.
A project is created in a specific language. However, since the third-party plug-ins used are not written in this language, the uploaded plug-ins use more languages than the primary language.
For example, a Java web project references a lot of CSS, and the entire color bar becomes purple, leading to my eye.

In fact, the solution is very simple, without any tricks.

Github uses Linguist to detect the language used. In addition to some basic functions, it also provides the overrides function.

You only need to add a. gitattributes in the project. The content is:

*.js linguist-language=Java*.css linguist-language=Java


That is to say, it is simple and rough to count all js and css suffix files as Java.

Alternatively, you can use the linguist-vendored attribute to set whether to perform statistics. For example:

special-vendored-path/* linguist-vendoredjquery.js linguist-vendored=false

 

GitHub Tutorials:

GitHub tutorials

Git tag management details

Git branch management

Git remote repository details

Git local Repository (Repository) Details

Git server setup and Client installation

Git Overview

Share practical GitHub tutorials

GitHub details: click here
GitHub: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.