在GitHub上更改存储库语言 [英] Changing repository language on GitHub

查看:77
本文介绍了在GitHub上更改存储库语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到Github选择JavaScript作为我的Django应用程序的语言:

I've noticed that Github picked JavaScript as the language for my Django app:

是否可以将其更改为Python?还是我需要建立一个新的存储库?

Is it possible to change it to Python? Or do I need to make a new repository?

已解决:

正如@Geno Chen所说,要更改存储库语言,我们必须添加包含以下代码的.gitattributes文件:

As @Geno Chen said, to change the repository language we have to add the file .gitattributes containing this code:

# to change language of repo from Javascript to Python
    *.js linguist-language=Python

推荐答案

语言检测器统计程序在您的项目中,并以比率显示结果.如果您的存储库检测到错误的语言,则可以按照教程进行操作,大多数情况下,您只需要使用覆盖结果存储库根目录中的.gitattributes包含类似于本教程中的示例的内容,以手动提高特定编程语言的比例:

The language detector stats the programs in your projects and shows the result with the ratio. If your repository have detected a wrong language, you can follow the tutorial, most of the time you just need to override the result with a .gitattributes in the repository root containing something like the sample from tutorial, to manually pull up the ratio of specific programming language:

# Example of a `.gitattributes` file which reclassifies `.rb` files as Java:
*.rb linguist-language=Java

这篇关于在GitHub上更改存储库语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆