修复 github 项目的语言属性

issue

Laravel 开源电商项目源码 被 github 判断认为是 HTML 项目,但是实际项目并没有 html 代码。

《修复 github 项目的语言属性》

这就尴尬了,只有默默的通过 google 搜索 github change project type 发现这篇文章:How to Change Repo Language in GitHub

简单来说只要在项目根目录下添加 .gitattributes 文件,然后通过设置相关目录或者类型文件标记为相关语言即可。

gitattributes

支持的属性语法如下:

  • linguist-documentation
  • linguist-language
  • linguist-vendored
  • linguist-generated
  • linguist-detectable

usage

*.css linguist-vendored
*.js linguist-language=Vue
modules/* linguist-language=PHP

resources

github/linguist

    原文作者:iBrand
    原文地址: https://segmentfault.com/a/1190000017556047
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞