I have created a test git repo on Git server:
/var/cache/git/username/myGitRepo.git
Which is a 'bare' git repo. The ownership of the files belong to this 'username' user. I can clone the above Git repo, on another Windows machine.
git clone git://myhost/var/cache/git/username/myGitRepo.git
The repo clones correctly. Then I can do local commits and try to push the changes back to my Git server:
git push origin master
But that gives a permission error on the server:
fatal: remote error: access denied or repository not exported: /git/username/myGitRepo.git
I added the magic file 'git-daemon-export-ok
' file in the repo dir. But I keep getting the above error.
I even set the chmod
to 777
of the /var/cache/git/username/myGitRepo.git
Getting same error.
Git remote -v throwing following output.
$ git remote -v
origin git://myhost/git/username/myGitRepo.git (fetch)
origin git://myhost/git/username/myGitRepo.git (push)
Anyone could help me to get this error resolved?
Best Answer
Out of the box, the standard
git-daemon
does not allow you topush
into repositories. The man page says:If you really want to enable anonymous
push
(and really, you don't; just usessh
), you need to enable thereceive-pack
service, which is disabled by default (because it's a bad idea). Again, from the man page (the SERVICES section):The bold is mine. You can enable this service globally by passing the
--enable=receive-pack
command line option, or per-repository by settingdaemon.receivepack
totrue
in your repository's git configuration.