2

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 coming 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'
Gregory
  • 557
  • 6
  • 17
  • Have you committed anything in your local repository? It doesn't look like it from what you have here. – ebneter Jan 14 '11 at 08:33
  • I forgot to paste it, but I did push something – Gregory Jan 15 '11 at 09:29
  • and what git version do you have? there may be issues with cloning empty git repositories with git prior to 1.6.2: http://stackoverflow.com/questions/1298190/gitosis-and-git-clone-problem – ssmir Jan 15 '11 at 19:37
  • I installed the latest gti version 1.7.x and still the same problem... – Gregory Jan 16 '11 at 09:15
  • I pasted the output log when I clone and push – Gregory Jan 16 '11 at 10:31
  • @Gregory Concerning your last log: did you commit anything before pushing? If you didn't commit anything then there is nothing to push. – ssmir Jan 17 '11 at 03:19

3 Answers3

2

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?

mbx
  • 6,292
  • 6
  • 58
  • 91
0

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.

ssmir
  • 1,522
  • 8
  • 10
  • I've already tried all these solutions and i'm still at the same point... :/ – Gregory Jan 13 '11 at 20:45
  • Can you also post the contents of the gitosis.conf and the results of `ls -l /srv/gitosis/repositories` or wherever your repos are located on the server. – ssmir Jan 13 '11 at 21:25
  • I've tried your commands with your config and they really don't work. Then I've tried clone and it worked. – ssmir Jan 14 '11 at 08:27
  • Even if i am cloning the repo I get the same message error during the cloning :/ – Gregory Jan 15 '11 at 09:28
0

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
Dele
  • 25
  • 1
  • 6
philipp
  • 93
  • 8