Git 存储库的 MIME 类型是什么?
我想通过 <link rel="vcs" type="???" href="http://git.example.org/foo.git"/>
从项目网页链接它,但为此我需要知道整个 git 存储库的 MIME 类型。
git 从 HTTP 传输中获取的第一个文件是 /info/refs?service=git-upload-pack
, 它的 MIME 类型为 application/x-git-upload-pack-advertisement
.但这并不适用于整个存储库。
最佳答案
有一个人 proposes使用
<link rel="vcs-git" href="git://example.org/foo.git" title="foo git repository"/>
为此目的。
让我感到奇怪的是,也叫 cweiske 的人有一个名为 phorkie 的 github 项目这恰恰表明以下内容:
remote pastes can be forked (rel="vcs-git" and gist.github.com)
(由我标记)
您是否已经知道解决方案并希望对其进行确认?
编辑:
正如 OP 在他的评论中提到的,他正在寻找一种不同的方式(即不是 rel="vcs-git"
)。
据我所知
- there's no official MIME-type for a git repo (以及其他目录)
- 显然需要(至少是 OP 的需要)定义一个
那么,让我们开始吧:
- classification in categories at IANA指示使用应用程序,因为其他(音频、示例、图像、消息、模型、多部分、文本、视频)绝对是错误的。
- an
X-
prefix is used for non standard files . - 应用程序名称将是
git
那么,为什么不从现在开始使用 application/x-git
...
关于git - git 存储库的 MIME 类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12627114/