Pushing a new repo to Gitosis
I just set up a gitosis server. Everything went well. I have been able to clone on my laptop the gitosis-admin project, configure gitconf, add a user and push everything.
But I get an access error when I try to push a new repository. I've tryied everything, look everywhere and I haven't been able to fix this thing!
git init
git remote add origin git@YOUR_SERVER_HOSTNAME:proj.git
git push origin master
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly
I've read that I could be co开发者_开发知识库ming the authorized_keys from /home/git/.ssh but this file doesn't exist.
Does someone knows how I could fix this? Greg
[edit] My gitosis.conf
[gitosis]
[group gitosis-admin]
writable = gitosis-admin
members = gregorymarcilhacy@MacBook-Pro-de-Gregory-Marcilhacy.local greg
[group proj]
writable = proj
members = gregorymarcilhacy@MacBook-Pro-de-Gregory-Marcilhacy.local greg
Here is what I have in repositories
greg@server:/home/git/repositories$ ls -l
total 4
drwxr-x--- 8 git git 4096 2011-01-13 18:58 gitosis-admin.git
Outup form log:
git clone git@git.flatfolio.com:flatfolio.git
Initialized empty Git repository in /private/tmp/flatfolio/.git/
DEBUG:gitosis.serve.main:Got command "git-upload-pack 'flatfolio.git'"
DEBUG:gitosis.access.haveAccess:Access check for 'greg' as 'writable' on 'flatfolio.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'flatfolio.git', new value 'flatfolio'
DEBUG:gitosis.group.getMembership:found 'greg' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'greg' in 'flatfolio'
DEBUG:gitosis.access.haveAccess:Access ok for 'greg' as 'writable' on 'flatfolio'
DEBUG:gitosis.access.haveAccess:Using prefix 'repositories' for 'flatfolio'
DEBUG:gitosis.serve.main:Serving git-upload-pack 'repositories/flatfolio.git'
warning: You appear to have cloned an empty repository.
This works fine. But when I push it fails :s
git push origin master:refs/heads/master
DEBUG:gitosis.serve.main:Got command "git-receive-pack 'flatfolio.git'"
DEBUG:gitosis.access.haveAccess:Access check for 'greg' as 'writable' on 'flatfolio.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'flatfolio.git', new value 'flatfolio'
DEBUG:gitosis.group.getMembership:found 'greg' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'greg' in 'flatfolio'
DEBUG:gitosis.access.haveAccess:Access ok for 'greg' as 'writable' on 'flatfolio'
DEBUG:gitosis.access.haveAccess:Using prefix 'repositories' for 'flatfolio'
DEBUG:gitosis.serve.main:Serving git-receive-pack 'repositories/flatfolio.git'
error: src refspec master does not match any.
error: failed to push some refs to 'git@git.flatfolio.com:flatfolio.git'
In Addition to what the other s said:
You should check you post-update hook on the server - is it executable, or maybe a dead link due to some distribution update issues?
If you managed to push gitosis-admin then your public key works well.
It appeared that I use git clone git@YOUR_SERVER_HOSTNAME:proj.git
to clone an empty repository so there is no need to initialize it first.
you try to clone/fetch/push this URL:
git clone git@git.flatfolio.com:flatfolio.git
but where did you define it?
It should read:
[group flatfolio]
writable = flatfolio
members = gregorymarcilhacy@MacBook-Pro-de-Gregory-Marcilhacy.local greg
精彩评论