Github将存储库更改为错误的语言 [英] Github changes repository to wrong language

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

问题描述

我知道这不是一个大问题,但我喜欢我的Github语言多样化。我在Swift中编写了一个项目,当我提交它说它在Objective C中。



我认为这可能是因为Parse框架是用Objective C编写的, ,但是有什么方法可以改变主存储库页面上的显示语言吗? 正如 GitHub帮助页面


GitHub使用开源的 Linguist图书馆确定用于语法突出显示和存储库统计信息的文件语言。

某些文件很难识别,有时项目包含比其主代码更多的库和供应商文件。


< blockquote>

因此,您需要使用 <


code> github / linguist#troubleshooting 以解决这种情况。百分比是根据列表语言报告的每种语言的代码字节计算的API
如果酒吧报告的语言不符合您的预期:


  • 点击关于统计栏中语言的名称,以查看被识别为该语言的文件列表。

  • 如果您看到没有写入的文件,请考虑移动文件转换为适用于自营代码的路径,或使用手动覆盖功能忽略它们。

  • 如果文件被错误分类,请搜索开放问题,看看是否有其他人已经报告过这个问题。您可以添加任何信息,特别是公共存储库的链接,这很有帮助。

  • 如果没有关于此错误分类的报告问题,打开一个问题,并包含指向存储库的链接或者被错误分类的代码示例。







2017年2月更新(一年后):

文章 Monica Powell 的nofollow noreferrer>如何更改GitHub中的Repo语言 在研究如何解决GitHub错误分类项目语言的过程中,我发现解决方案就像告诉GitHub要忽略的文件。



虽然您仍然希望将这些文件提交到GitHub,因此无法使用 .gitignore ,但您可以告诉GitHub的语言学家要忽略哪些文件 .gitattributes 文件




  static / * linguist-vendored 




这个单行文件告诉GitHub忽略我的静态/ 文件夹中的所有文件,这是为Flask应用程序存储CSS和其他资产的地方。



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.

I think it might be because the Parse frameworks are written in Objective C and it detects that, but is there any way to change the display language on the main repository page?

解决方案

As mentioned in the GitHub help page

GitHub uses the open source Linguist library to determine file languages for syntax highlighting and repository statistics.
Some files are hard to identify, and sometimes projects contain more library and vendor files than their primary code.

So you need to check with github/linguist#troubleshooting in order to fix this situation.

The percentages are calculated based on the bytes of code for each language as reported by the List Languages API.
If the bar is reporting a language that you don't expect:

  • Click on the name of the language in the stats bar to see a list of the files that are identified as that language.
  • If you see files that you didn't write, consider moving the files into one of the paths for vendored code, or use the manual overrides feature to ignore them.
  • If the files are being misclassified, search for open issues to see if anyone else has already reported the issue. Any information you can add, especially links to public repositories, is helpful.
  • If there are no reported issues of this misclassification, open an issue and include a link to the repository or a sample of the code that is being misclassified.


Update February 2017 (one year later):

The article "How to Change Repo Language in GitHub" from Monica Powell

Upon researching how to resolve GitHub misclassifying the language of your projects I found out the solution is as simple as telling GitHub which files to ignore.

While you still want to commit these files to GitHub and therefore can’t use a .gitignore you can tell GitHub’s linguist which files to ignore in a .gitattributes file

static/* linguist-vendored

This one-line file told GitHub to ignore all of my files in my static/ folder which is where CSS and other assets are stored for a Flask app

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

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