Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
696 views
in Technique[技术] by (71.8m points)

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

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

question from:https://stackoverflow.com/questions/1961274/git-warning-remote-head-refers-to-nonexistent-ref-unable-to-checkout

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...