我刚刚建立了一个gitosis服务器。一切顺利。我已经能够在我的笔记本电脑上克隆gitosis-admin项目,配置gitconf,添加用户并推送所有内容。
但是当我尝试推送新的存储库时,我收到了访问错误。我已经尝试了一切,到处寻找,我无法解决这个问题!
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
我已经读过,我可以从/home/git/.ssh来到authorized_keys,但是这个文件不存在。
有人知道如何解决这个问题吗? 格雷格
[编辑] 我的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
这是我在存储库中的内容
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.
这很好用。 但当我推动它失败时: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'
答案 0 :(得分:2)
除了对方说的话:
您应该检查服务器上的更新后挂钩 - 它是可执行的还是maybe a dead link due to some distribution update issues?
答案 1 :(得分:0)
如果你设法推动gitosis-admin,那么你的公钥效果很好。
似乎我使用git clone git@YOUR_SERVER_HOSTNAME:proj.git
克隆空存储库,因此无需先对其进行初始化。
答案 2 :(得分:0)
您尝试克隆/获取/推送此网址:
git clone git@git.flatfolio.com:flatfolio.git
但你在哪里定义它?
应该是:
[group flatfolio]
writable = flatfolio
members = gregorymarcilhacy@MacBook-Pro-de-Gregory-Marcilhacy.local greg