-1

I'm testing my new Git repository. I converted from Subversion to Git, no problem.

Now, on my laptop

git remote add origin git@server:test.git

returns correctly. But when I do

git push

I get

error:gitosis.serve.main:repository read access denied

And when I go to /srv/git/repositories on the server, the new repository isn't created.

Is there a log file that I can look at somewhere to figure out what's going on?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
scphantm
  • 4,293
  • 8
  • 43
  • 77

3 Answers3

1

Repositories cannot be created with git push. You have to use git init --bare on the server for that.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
knittl
  • 246,190
  • 53
  • 318
  • 364
  • Why bare? Maybe he starts with code on the 'server'? (GIT doesn't really have servers though...) – Rudie Aug 11 '11 at 21:15
  • @rudie: most of the time it's a bad idea to push into a non-bare repository, as it will bring your working tree and index out of sync. if he wants to have a worktree on the server, he's better off using hooks to call `fetch`+`reset --hard` from another repository containing the worktree. – knittl Aug 11 '11 at 21:18
0

Carefully follow the "Setting Up" portion of the README. It describes access control. You'd be much better off using gitolite instead. It's easier to use and better-documented. Gitosis is pretty much dead.

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199
0

I went ahead and switched to Gitolite. After tracking down some SSH issues it worked fine. Gitolite generates the repositories on the server when you push it.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
scphantm
  • 4,293
  • 8
  • 43
  • 77