I've set up apache to use git-http-backend as per the instructions in the pro git book, and its manpage. My apache config now looks like:
SetEnv GIT_PROJECT_ROOT /var/www/git
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
AuthName "Git Access"
Require group committers
I can clone a repo using
git clone http: //user@url/git/repo.git
which prompts me for the password for 'user', then continues. However, when I attempt to push, I'm prompted for my password twice, and then get an error:
Cannot access URL http: //user@url/git/repo.git/, return code 22
(I've inserted a space into the URLs, because the spam prevention mechanism won't let me post otherwise)
When I look at my apache log, I see:
192.168.1.151 - - [12/Sep/2010:20:11:22 +0100] "GET /git/repo.git/info/refs?service=git-receive-pack HTTP/1.1" 403 - "-" "git/220.127.116.11"
192.168.1.151 - - [12/Sep/2010:20:11:23 +0100] "GET /git/repo.git/info/refs HTTP/1.1" 200 59 "-" "git/18.104.22.168"
192.168.1.151 - - [12/Sep/2010:20:11:23 +0100] "GET /git/repo.git/HEAD HTTP/1.1" 200 23 "-" "git/22.214.171.124"
192.168.1.151 - - [12/Sep/2010:20:11:26 +0100] "PROPFIND /git/repo.git/ HTTP/1.1" 404 - "-" "git/126.96.36.199"
I've added 'user' to the 'committers' group on the server (seemed easiest to just follow the instructions), and my local .netrc (chmodded 600) looks like this:
Every instruction I've found seems slightly unclear as to whether I have to enable DAV for the dir in question (I thought that was the old way to do it, though). I could just use gitolite, but I'd like to get to the bottom of this first…