2

There are some git bare repo in /home/git/repositories dir.
I use git-daemon-run serve git protocol to access these repos.
For example /home/git/repositories/root/spider.git is a bare git repo.

This is command ps -ef | grep git result.

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

When I exec git clone git://hostname/root/spider.git, I get :

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

I check the syslog /var/log/git-daemon/current, I get :

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)
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
王振威
  • 35
  • 1
  • 3

3 Answers3

4

Add --enable=receive-pack to the git daemon command line, to enable send-pack (manual) support. You will then need to git reset --hard.

Will
  • 24,082
  • 14
  • 97
  • 108
user55993
  • 311
  • 3
  • 6
  • 1
    Thank you. This solved the `fatal: remote error: access denied or repository not exported` error for me. This seems to be required if you want to `git push` without using any authentication. It basically enables anonymous push. – peterevans May 22 '20 at 08:40
2

From the error message, double check your path and make sure you did a

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

If that repo already existed, but directly in '/home/git/repositories', then you would need to adapt your git clone command:

 git clone git://hostname/spider.git

Finally, make sure the process git-daemon has the right to access the repository.

The account running the git-dameon must be able to access /home/git/repositories/root/sipder.git.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for your answer,but the problem is not resolve yet.I did double check the path and adapt my command. – 王振威 Mar 08 '13 at 11:57
  • 1
    @王振威 then is it a right issue? Does the process has the right to access `/home/git/repositories/root/sipder.git`? Is that bare repo protected for root? – VonC Mar 08 '13 at 12:05
  • Thank you!The reson is that the process has no permission to access the repo,I have resolved it! – 王振威 Mar 09 '13 at 02:00
  • @王振威 Excellent. I have included that in the answer, for more visibility, and for you to select. – VonC Mar 09 '13 at 05:20
1

Create a empty file called git-daemon-export-ok in the repo dir.

shankar
  • 19
  • 1