tags:

views:

497

answers:

3

I'm trying to setup gitosis according to the instructions here.

It works fine from my remote machine so the server seems to be setup fine but I'd also like to be able to do development on my gitosis server machine from a different user account (not the git user created in the gitosis setup).

I've copied the key and modified the gitosis.conf so that the other user account has access but when I try to clone it seems to work except at the end it says:

git Warning: remote HEAD refers to nonexistent ref, unable to checkout

and I end up with an empty directory except for .git

I've google for this a bit but have no real insight into what the problem is

+3  A: 
  1. Do the git branch -r and git checkout -b master <remotebranchofinterest>

  2. Check the HEAD file in remote .git.

  3. Check if somebody already asked the question: here

Michael Krelin - hacker
A: 

Keep it simple. Add to gitosis authorization and SSH key for the user account on your server and clone as usual:

user@server$ git clone git@server:repo.git
Greg Bacon
That's exactly what I did and that resulted in the error message. Access appears to be fine based on the git output (I enabled debugging to give me more insight).
srboisvert
+1  A: 

I found out what was going wrong. The problem was that I wasn't paying attention to the warnings when I was pushing to my gitosis server so I didn't realize that I wasn't pushing a particular branch. I had assumed it would just push the current but that isn't the case until you set:

git config push.default current
srboisvert
This is the post that tipped me off to it: http://stackoverflow.com/questions/1475468/git-push-failed-you-did-not-specify-any-refspecs-to-push and the fact that when I did git branch -r based on Michael Krelin's answer and got nothing back.
srboisvert