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: