tags:

views:

47

answers:

2

I've just pushed my first repo to github but when I browse my html it is served as txt. Is this something that I can set similar to svn's props? Or is this simply a github inadequacy?

I can't seem to find anything on git, github or here that helps.

+1  A: 

Git, unlike SVN is not concerned with individual files, rather with commits so I believe you cannot set mime-type props on files. On the other hand, github is a "code hosting site", which manages your code repositories and is only concerned about showing code. The exception from this rule is README files, where you can sort-of specify different formats (like .markdown) and render them as semi-HTML and wiki pages.

If what you want is to host your HTML files (like in a webserver) then github is not the place to do it. Rather, you can keep your files under github's version control, but check out and serve them from a webserver like apache.

Zaki
There's also [github pages](http://pages.github.com/) which lets you host arbitrary HTML.
Mike Dinsdale
Correct, git doesn't store it although TECHNICALLY it could in the tree.
mathepic
+1  A: 

First, Subversion supports (versioned) properties (simple key=value pairs) on files, diertories and revisions. This includes svn:mime-type property for a file. This approach (this feature) looks like remnants of original BerkeleyDB storage engine, and reminds a bit "resource forks" on (older?) MacOS filesystems.

The closest equivalent of Subversion's file properties in Git would be gitattributes (per-path attributes). You could define mime-type gitattribute, but currently no Git tool (known to me) uses it. Note that in contrast to Subversion gitattributes are stored in an ordinary file: in-tree .gitattributes file (which can be versioned), and per repository user's .git/info/attributes file... which can be edited in ordinary editor, and not only using SCM commands.


Second, mime-types or mimetype-like property or attribute is not really necessary. Gitweb (and probably other git interfaces) use file with extension to mimetype mapping (/etc/mime.types by default), so that e.g. '*.html' files are served *in 'raw' mode (i.e. 'blob_plain' action)* are served with 'text/html' content-type, see e.g. http://repo.or.cz/w/git.git/blob_plain/html:/gitattributes.html

It's the lack in GitHub web interface that http://github.com/git/git/raw/html/gitattributes.html is served with 'text/plain' content-type...

Jakub Narębski