为什么我可以使用git-daemon服务我的git仓库



/home/git/repositories目录下有一些git裸库
我使用git-daemon-run服务git协议访问这些仓库。
例如,/home/git/repositories/root/spider.git是一个裸git仓库。

这是ps -ef | grep git命令的结果。

120       9638  1062  0 10:44 ?        00:00:00 /usr/local/libexec/git-core/git-daemon --verbose --reuseaddr --base-path=/home/git/repositories --export-all --max-connections=64 -- /home/git/repositories

当我执行git clone git://hostname/root/spider.git时,我得到:

Cloning into 'spider'...
fatal: remote error: access denied or repository not exported: /root/spider.git

我检查syslog /var/log/git-daemon/current,我得到:

2013-03-08_02:56:02.42145 [9698] Connection from 127.0.0.1:60080
2013-03-08_02:56:02.42149 [9698] Extended attributes (22 bytes) exist <host=hostname>
2013-03-08_02:56:02.42186 [9698] Request upload-pack for '/root/spider.git'
2013-03-08_02:56:02.42189 [9698] '/home/git/repositories/root/spider.git' does not appear to be a git repository
2013-03-08_02:56:02.42221 [9638] [9698] Disconnected (with error)

--enable=receive-pack添加到git daemon命令行,以启用send-pack(手动)支持。然后您需要git reset --hard .

从错误消息中,仔细检查您的路径并确保您执行了

cd /home/git/repositories/root/
git init --bare spider

如果这个repo已经存在,但是直接在' /home/git/repositories '中,那么你需要调整你的git clone命令:

 git clone git://hostname/spider.git

最后,确保进程git-daemon具有访问存储库的权限。

运行git- daemon的帐号必须能够访问/home/git/repositories/root/sipder.git

在repo目录下创建一个名为git-daemon-export-ok的空文件

最新更新