第一次安装 git 守护进程。我让它运行:
[todd@hqdevgit01 test.git]$ ps -ef | grep git
501 3204 1 0 10:14 ? 00:00:00 git-daemon --reuseaddr --user=gitdaemon --group=blah-dev --detach --base-path=/var/blah/git-repo/
我将 gitdaemon 用户设置为:
[todd@hqdevgit01 test.git]$ grep gitdaemon /etc/group
blah-dev:x:502:todd,gitdaemon
gitdaemon:x:503:
并且存储库设置为:
[todd@hqdevgit01 test.git]$ ll /var/blah/git-repo/test.git
total 32
drwxrwsr-x. 2 root blah-dev 4096 May 1 10:11 branches
-rw-rw-r--. 1 root blah-dev 92 May 1 10:11 config
-rw-rw-r--. 1 root blah-dev 73 May 1 10:11 description
-rw-rw-r--. 1 root blah-dev 23 May 1 10:11 HEAD
drwxrwsr-x. 2 root blah-dev 4096 May 1 10:11 hooks
drwxrwsr-x. 2 root blah-dev 4096 May 1 10:11 info
drwxrwsr-x. 4 root blah-dev 4096 May 1 10:11 objects
drwxrwsr-x. 4 root blah-dev 4096 May 1 10:11 refs
然后在客户端
me@me:~/projects/test$ git remote add test todd@hqdevgit01:/test.git
me@me:~/projects/test$ git pull test
todd@hqdevgit01's password:
fatal: '/test.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
不完全确定我在这里缺少什么。我认为 git daemon 命令中的基本路径应该是我需要绑定我的目录并将我的存储库显示在“根”路径中的全部。
也试图开始
git daemon --reuseaddr --user=gitdaemon --group=blah-dev --detach --base-path=/var/blah/git-repo/ /var/blah/git-repo/
没有骰子
添加了“git-daemon-export-ok”
[todd@hqdevgit01 test.git]$ ll
total 32
drwxrwsr-x. 2 root blah-dev 4096 May 1 10:11 branches
-rw-rw-r--. 1 root blah-dev 92 May 1 10:11 config
-rw-rw-r--. 1 root blah-dev 73 May 1 10:11 description
-rw-rw-r--. 1 todd blah-dev 0 May 1 10:36 git-daemon-export-ok
-rw-rw-r--. 1 root blah-dev 23 May 1 10:11 HEAD
drwxrwsr-x. 2 root blah-dev 4096 May 1 10:11 hooks
drwxrwsr-x. 2 root blah-dev 4096 May 1 10:11 info
drwxrwsr-x. 4 root blah-dev 4096 May 1 10:11 objects
drwxrwsr-x. 4 root blah
仍然无法正常工作(同样的错误)
这是一个多方面的错误 - 但我需要排除回购:
git remote add test todd@hqdevgit01:/var/blah/git-repo/test.git
也正如 FOLKOL 提到的(来自我的启动脚本):
USER=gitdaemon
GROUP=blah-dev
BASE_PATH=/var/blah/git-repo/
ARGS="--user=$USER --group=$GROUP --detach --reuseaddr --base-path=$BASE_PATH $BASE_PATH"
git daemon $ARGS