0

Installing git daemon for the first time. I have it running:

[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/

I have gitdaemon user set up as:

[todd@hqdevgit01 test.git]$ grep gitdaemon /etc/group
blah-dev:x:502:todd,gitdaemon
gitdaemon:x:503:

and the repository set up as:

[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

THEN on the client

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.

Not completely sure what I am missing here. I think the base path in the git daemon command should be all I need to tie out my directory and to present my repositories in the "root" path.


also tried to start as

git daemon --reuseaddr --user=gitdaemon --group=blah-dev --detach --base-path=/var/blah/git-repo/ /var/blah/git-repo/

no dice


added "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

still not working (same error)


THis is a multi-faceted error - but I needed to path out the repo:

git remote add test todd@hqdevgit01:/var/blah/git-repo/test.git

ALSO as mentioned by FOLKOL (from my startup scrcipt):

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
akaphenom
  • 6,728
  • 10
  • 59
  • 109

1 Answers1

4

The connection string that you are using is a ssh-connection (user@host:path), to clone from the git daemon, use a string of this form: git://host/test.git.

$ git clone git://hqdevgit01/test.git

You have to add a file named git-daemon-export-ok, to mark a git repo as shareable by the git daemon.

Or you can add --export-all when invoking the daemon.

$ git daemon --base-path=. --export-all --reuseaddr --verbose

See the documentation for details.

folkol
  • 4,752
  • 22
  • 25
  • I just re-read your question more carefully. And the connection string that you are using in the client is the ssh one. (user@host:path), to clone from the git-daemon, use a connection string of this form: git://host/test.git. – folkol May 01 '15 at 20:38
  • thanks for the reread. apparently you need to set the remote repository up from root on the server NOT relative to the git daemon start path. now I am trying to get it to run in initd... – akaphenom May 01 '15 at 21:13
  • accepting, export all is a parital solution (to my multi-faceted problem) – akaphenom May 04 '15 at 13:00