/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的空文件