Published on

Customizing GitHub 'Languages' section in repository

Authors
  • avatar
    Name
    hwahyeon
    Twitter

On the bottom right of a GitHub repository, the "Languages" section provides information about which programming languages are used in the repository. If there are certain file types that you don't want to be included in this language analysis or if you want specific file types to be included, you can use the linguist-detectable attribute in a .gitattributes file.

To exclude specific language files

You can use the linguist-detectable=false attribute in the .gitattributes file to exclude certain files from GitHub's language analysis. For example, if you want to exclude CSS and HTML files from being detected, create a .gitattributes file at the root of your repository with the following code:

*.css linguist-detectable=false
*.html linguist-detectable=false

To include certain files

If you want files that are not normally detected by GitHub to be included in the language statistics, you can use linguist-detectable=true. For example, to include Markdown files in the language stats:

*.md linguist-detectable=true