tags:

views:

175

answers:

1

I keep my bare repositories on an AFS file server, mounted locally. When I clone them, I do

git clone --no-hardlinks file:///afs/whereever.foo.bar/myrepository.git

I frequently get the following:

warning: remote HEAD refers to nonexistent ref, unable to checkout.

and no files. This is easily fixed with

git branch master origin/master  
git checkout master

but I was wondering how to fix it so this isn't necessary.

Thanks,
Liam

+2  A: 

check the /afs/whereever.foo.bar/myrepository.git/HEAD file.

Michael Krelin - hacker
OK I've checked it. It referred to a non-master branch, apparently one that doesn't exist anymore (I recognize the name as one I used at one point, but it's not in there anymore). So I changed that to ref: refs/heads/master and now the repository clones just fine, no error. So my next question is, how did that end up in HEAD instead of refs/heads/master? Thanks for the pointer.
Liam
It's hard to tell now, there's a plenty of ways you could've set that.
Michael Krelin - hacker