Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MIME type of a git repository?

Tags:

git

mime-types

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.

like image 662
cweiske Avatar asked Sep 27 '12 17:09

cweiske


People also ask

How do I know my MIME type?

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.

What is a MIME file type?

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.

What is the default MIME type?

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.

Which of these are MIME types?

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.


1 Answers

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

  • there's no official MIME-type for a git repo (as well as for other directories)
  • apparently there's a need (at least it's OP's need) to define one

So, let's get it on:

  • the classification in categories at IANA indicates to use application because the others (audio, example, image, message, model, multipart, text, video) would be absolutely wrong.
  • an X- prefix is used for non standard files.
  • the application name would be git

So, why not use application/x-git from now on...

like image 153
eckes Avatar answered Oct 01 '22 14:10

eckes