git repos on static hosting


I want to show off a bunch of my git repositories.

I don’t want to use FIXME: enumerate some reasons why

a third party “git hosting service” like GitHub, BitBucket, GitLab, SourceForge, etc.

I don’t want to even though these projects seem cool and good

have to host, secure, and maintain a constantly running piece of software like gogs, gitea, or even cgit.

I want to plop a git repo right onto my static website in such a way that:

If you have a static web host with a shell and you can run git there, you can host git repos this way.

You can even set it up as a “git forge” where you host several repos that many people can push to.

But what if you have no git, or even no shell, on your web host? You have to use sftp or aws s3 cp or submit a .zip file through a web-form to update your site?

Even under those constraints, it is possible! (With some inefficiencies.) More on that later.

Hosting a static git repo

Hosting a static git forge

Hosting a static git repo without git on the host

What if you have no shell or can’t run git on your web-host?

I’m a bit proud of this hack because I think it’s clever (which means it’s probably “too clever.”) But, it’s not very robust; in some situations it can make you lose commits.

I went into this thinking that static file hosting that does not include a shell or git was widely available and must surely be the cheapest by orders of magnitude. But it turns out that is not as common or cheap as I had imagined, compared to a (also very cheap) cloud computer with a lot more features.

Since most people have access to more than a static site, I don’t think it’s really useful to build and maintain a tool to facilitate this hack.

I’ll describe it here and if many people think it’s useful then I guess I’d reconsider maintaining a tool to make it easier.




git staticThe authors of git refer to static http transport protocol as “dumb” http protocol. I’ll decline to employ their language.

http transport

examples of git-less static webhosts

Cost comparison

TODO: tabulate