7

I'm attempting to set up a publicly-accessible git repository that can be cloned via HTTP on a server that I physically own and have root access to, but it seems like I'm missing something. I'm new to git so I can't troubleshoot very well, but here's what I know:

  1. I'm able to clone the git repository with git clone ssh://git@repo.alaskawh.com/awhsome-framework just fine
  2. git clone http://repo.alaskawh.com/framework fails with fatal: repository 'http://repo.alaskawh.com/framework/' not found
  3. http://repo.alaskawh.com/framework/ lists the file in the git repository just fine when I visit it in a web browser

/var/lib/gitolite/repositories/awhsome-framework.git is a symlink to /var/www/repo.alaskawh.com/framework/, I've created the file hooks/post-update which contains the line exec git update-server-info, and I've ensured that user permissions are correct.

Does anybody know what I'm doing wrong?

  • Have you implemented a Git Smart HTTP server per [these docs](http://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP)? – javabrett May 18 '15 at 22:15
  • 1
    @javabrett I didn't. I'm working on implementing it right now and it's doing something. –  May 18 '15 at 22:35

1 Answers1

3

You should set-up a Git Smart HTTP server backend. Additional documentation is available here. This will provide a simple and efficient Git hosting solution over HTTP.

javabrett
  • 7,020
  • 4
  • 51
  • 73
  • 1
    The problem is definitely that I'm missing a Git Smart HTTP server backend; however, I haven't been able to get it to work properly yet. Also, I found [these instructions](http://git-scm.com/docs/git-http-backend) to be more useful. –  May 18 '15 at 23:21
  • Thanks, I was going to add that link in the original answer but for some reason neglected to. Edited/added. – javabrett May 18 '15 at 23:50
  • 1
    I figured it out. The thing that I was missing was that value of `GIT_PROJECT_ROOT` must be the directory above the directory containing the git files. For example, `GIT_PROJECT_ROOT` is set to `/var/www/repo.alaskawh.com/framework`, the actual git directory is located at `/var/www/repo.alaskawh.com/framework/awhsome-framework.git`, and then I can clone it with `git clone http://repo.alaskawh.com/framework/awhsome-framework`. –  May 19 '15 at 00:44