Вы должны сообщить git-daemon
, что он может экспортировать ваш репозиторий:
$ git init --bare /tmp/my-repo.git
Initialized empty Git repository in /tmp/my-repo.git/
$ git daemon --verbose --base-path=/tmp --export-all /tmp/my-repo.git &
$ git clone git://`hostname`/my-repo.git
Initialized empty Git repository in /tmp/my-repo/.git/
warning: You appear to have cloned an empty repository.
Гораздо лучший способ - запустить его с xinetd
. Создайте и настройте /etc/xinetd.d/git
в соответствии с
# description: The git server offers access to git repositories
service git
{
disable = no
type = UNLISTED
port = 9418
socket_type = stream
wait = no
user = nobody
server = /usr/local/bin/git
server_args = daemon --inetd --export-all --base-path=/pub/scm
log_on_failure += USERID
}
Не забудьте sudo killall -HUP xinetd
. Теперь все git-репозитории ниже /pub/scm
будут доступны всем, кто спрашивает.