问题描述
我知道这没什么大不了的,但我喜欢我的 GitHub 在语言上多样化.我用 Swift 写了一个项目,当我提交它时说它在 Objective-C.
I know this isn't a huge deal, but I like my GitHub to be linguistically diversified. I wrote a project in Swift and when I commit it says it's in Objective-C.
我认为这可能是因为 Parse 框架是用 Objective-C 编写的,它会检测到这一点,但是有没有办法更改主存储库页面上的显示语言?
I think it might be because the Parse frameworks are written in Objective-C and it detects that, but is there a way to change the display language on the main repository page?
推荐答案
我发现最简单的方法是在我的存储库的根文件夹中创建一个名为 .gitattributes
的文件,并将这些内容提供给它:
I found the simplest thing was to create a file called .gitattributes
in the root folder of my repository, and give it these contents:
* linguist-vendored
*.js linguist-vendored=false
这个例子告诉 GitHub/Linguist 忽略所有文件,然后只看 .js 文件.我的项目,https://github.com/aim12340/jQuery-Before-Ready,被列为 HTML,因为 HTML 示例文件比 JavaScript 文件大.这个文件为我修复了它,现在它被列为 JavaScript.
This example tells GitHub/Linguist to ignore all files, and then just look at .js files. My project, https://github.com/aim12340/jQuery-Before-Ready, was listed as HTML because the HTML example files were bigger than the JavaScript files. This file fixes it for me and now it's listed as JavaScript.
这篇关于GitHub 将存储库更改为错误的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!