更改存储库语言github

时间:2019-03-01 14:02:25

标签: github

我注意到github为我的Django应用选择了语言Javascript(下图) enter image description here

是否可以将其更改为Python,或者我需要创建新的存储库?

已解决: 正如@Geno Chen所说,要更改存储库语言,我们必须添加.gitattributes文件并放置代码

将回购语言从Javascript更改为Python

*.js linguist-language=Python

2 个答案:

答案 0 :(得分:0)

language detector统计项目中的程序并以比率显示结果。如果您的存储库检测到错误的语言,则可以follow the tutorial,大多数情况下,您只需要在存储库根目录中使用.gitattributes override,其中包含本教程中的示例,以手动提高特定编程语言的比例:

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

答案 1 :(得分:0)

在您的存储库中创建一个新文件,并将其命名为.gitattributes。之后,请确保将linguist-detectable设置为true,如下所示:

*.css linguist-detectable=false
*.java linguist-detectable=false
*.python linguist-detectable=true 
*.js linguist-detectable=false
*.html linguist-detectable=false  
*.xml linguist-detectable=false 
相关问题