title: Pushing a new repo to Gitosis
body: <p>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.</p>
  
  <p>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!</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I've read that I could be coming the authorized_keys from /home/git/.ssh but this file doesn't exist.</p>
  
  <p>Does someone knows how I could fix this?
  Greg</p>
  
  <p>[edit]
  My gitosis.conf</p>
  
  <pre><code>[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
  </code></pre>
  
  <p>Here is what I have in repositories</p>
  
  <pre><code>greg@server:/home/git/repositories$ ls -l
  total 4
  drwxr-x--- 8 git git 4096 2011-01-13 18:58 gitosis-admin.git
  </code></pre>
  
  <p>Outup form log:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>This works fine.
  But when I push it fails :s</p>
  
  <pre><code>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'
  </code></pre>