What is the MIME type of a Git repository?
I'd like to link it from a project web page via <link rel="vcs" type="???" href="http://git.example.org/foo.git"/>
, but for that I need to know the MIME type of a whole git repository.
The first file that git fetches from the HTTP transport is /info/refs?service=git-upload-pack
, and it has a MIME type of application/x-git-upload-pack-advertisement
. But that's not for the whole repository.
For detecting MIME-types, use the aptly named "mimetype" command. It has a number of options for formatting the output, it even has an option for backward compatibility to "file". But most of all, it accepts input not only as file, but also via stdin/pipe, so you can avoid temporary files when processing streams.
Multipurpose Internet Mail Extension or MIME is an internet standard, encoded file format used by email programs. The mime format contains 8-bit encoded data instead of commonly used 7-bit encoding for sending email. Thus, MIME files can contain file attachments and richer character sets other than ASCII.
Two primary MIME types are important for the role of default types: text/plain is the default value for textual files. A textual file should be human-readable and must not contain binary data. application/octet-stream is the default value for all other cases.
A MIME type consists of two parts: a type and a subtype. Currently, there are ten registered types: application, audio, example, font, image, message, model, multipart, text, and video.
There's a guy that proposes to use
<link rel="vcs-git" href="git://example.org/foo.git" title="foo git repository"/>
for that purpose.
It strikes me odd that someone that is also called cweiske has a github project called phorkie that exactly suggests the following:
remote pastes can be forked (rel="vcs-git" and gist.github.com)
(Markup by me)
Did you already know the solution and want to have it confirmed?
Edit:
As OP mentions in his comment, he's searching for a different way (i.e. not rel="vcs-git"
).
As far as I could tell
So, let's get it on:
X-
prefix is used for non standard files.git
So, why not use application/x-git
from now on...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With