2009-08-19 142 views
2

我已经安装了gitosis,但当我使用回购协议时,我有些奇怪的事情。 在配置我有gitosis和git克隆问题

[gitosis] 

[group gitosis-admin] 
writable = gitosis-admin 
members = [email protected] [email protected] 

[group prj1] 
writable = prj1 
members = [email protected] 

,并在/ home/git的/库我已经创建的目录prj1.git与空混帐回购协议。

我可以用的gitosis管理员从服务器和笔记本电脑的工作没有问题,但是当我试图混帐克隆 prj1我的笔记本电脑,我看到

$ git clone [email protected]:prj1.git 
Initialized empty Git repository in /Users/alec/temp/prj1/.git/ 
fatal: no matching remote head 

好吧,让推prj1从笔记本电脑到服务器:

$ git push origin master:refs/heads/master 
ERROR:gitosis.serve.main:Repository read access denied 
fatal: The remote end hung up unexpectedly 

什么问题?

回答

5

在笔记本电脑上完成以下操作,是否可以解决此问题?
取而代之的是混帐克隆的:

mkdir prj1 
    cd prj1 
    git init 
    touch README 
    git add . 
    git commit -m "Added blank readme" 
    git remote add origin [email protected]:prj1.git 
    git push origin master 

ebneter增加的评论:

You might mention that the reason this works is that you can't clone an empty repo.
(As my users regularly discover...

这提醒OP问题:

... and in /home/git/repositories I have created directory prj1.git with empty git repo

这是不理想就在那里。
SO question提到克隆一个空的回购问题:

In other words, don't attempt to clone the empty repo, but rather after creating it, push to it a simple repo containing one innocuous file. Then it is no longer empty and can be cloned.


此后,Chris Johnsen评论:

Any Git later than 1.6.2

(所以实际上自2009年3月)

can “clone” empty repositories.
(scare quotes because it really just amounts normal initialization plus setting up a remote, and creating a tracking configuration for the presumed, eventual master branch).

+1

相同的结果 $混帐推起源主 错误:gitosis.serve.main:存储库中读取访问被拒绝 致命的:该远端挂了意外 – 2009-08-19 07:17:18

+0

呵呵...我已经删除了远程,然后添加回来 - 现在工作:)非常感谢! – 2009-08-19 07:20:48

+0

@Tim:感谢您的编辑。我错过了那一个。 – VonC 2010-02-24 20:39:32

5

我遇到了持续不断的问题en按照答案1中的步骤。

sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update 

对我解决它。显然老版本的setuptools可以使更新后的挂钩不可执行。请参阅this page

1

我遇到了同样的消息,之后我要推到一个新的存储库:

git push -u origin master 
ERROR:gitosis.serve.main:Repository read access denied 
fatal: The remote end hung up unexpectedly 

的原因是,我有2个相同的SSH酒馆键在gitosis-(相同的密钥,不同的名称)管理员/ keydir。

删除它的一个,我可以推到新的仓库

+0

确保从〜gitosis/.ssh/authorized_keys中删除其中的一个 – Dror 2012-02-07 00:42:15

0

有同样的问题,原因是我编辑我的本地gitosis.conf的,并没有提交到服务器。

0

在我的情况下,ssh客户端从〜/ .ssh中选择了错误的私钥。

[Gitosis的]日志级别= DEBUG帮助看到了错误的用户正在登录