Git over HTTP walkthrough
Posted by Erik Peterson on 01/25/2008 02:47

This is a separate post to publish how I solved the problem highlighted in my last post. Specifically, I wanted a read-only Git repository available over HTTP through Apache. I already had Apache set up and had a subdomain set up via Pound. All I needed to do was set up the Git repository so that it could be accessed over HTTP. Easy, right? Apparently not.

If someone has an easier solution, or I'm just approaching this problem incorrectly, feel free to let me know. I'm perfectly open to the idea that I'm a retard. After all, I am a terrible programmer.

Ok, so the deal is that, apparently, for this kind of repository, you can't just use git-init like you could with a normal local or remote repository. From what I've gleaned, you have to use git-init-db. Which is silly, because the man entries for the two appear to be almost identical. Again, maybe I'm just a tard, but I really don't understand the difference.

Even after that, git-clone wouldn't work, and I had to run git-update-server-info. Ho, ho, ho! But that wouldn't even work! I had to do git-update-server-info --force for some ungodly reason. Keep in mind, this is still on a completely empty repository.

Ok, so without further ado, here are the steps to get it actually working:


  mkdir myrepo.git
  GIT_DIR=myrepo.git git-init-db
  cd myrepo.git/
  chmod +x *
  git-update-server-info --force

Not exactly straightforward.