tags:

views:

192

answers:

2

I set up .git in a directory on my local machine. I then run:

mkdir a
cd a
git init
git daemon

When I attempt to clone the repository in a, I get the following error:

mkdir b
cd b
git clone git://127.0.0.1
Initialized empty Git repository in /b/127.0.0.1/.git/
fatal: The remote end hung up unexpectedly

How can I clone my repository over the git protocol?

+3  A: 
Greg Bacon
+2  A: 

You either have to put an empty file called git-daemon-export-ok into the repository or start git daemon with the --export-all option.

Quote from the git-daemon man page:

It verifies that the directory has the magic file "git-daemon-export-ok", and it will refuse to export any git directory that hasn't explicitly been marked for export this way (unless the --export-all parameter is specified). If you pass some directory paths as git daemon arguments, you can further restrict the offers to a whitelist comprising of those.

Fabian Jakobs