My understanding is that the default branch of a cloned repository is to be whatever HEAD points to in the repo being cloned.
I now have a case where this is not true. My understanding is obviously flawed, so what does determine the default checkout branch when cloning a (bare) repo?
The last commit on that repo was a merge between the branch referenced in the bare repo's HEAD into the branch I'm getting as the checkout branch in the clone.
Running git remote show origin
returns:
Fetch URL: ...
Push URL: ...
HEAD branch (remote HEAD is ambiguous, may be one of the following):
<bad-branch>
live
Remote branches:
...
Bare repo uses Git version 1.8.2.1, client uses 1.7.12.4, transport is SSH.
Maybe the answer is actually this one here. This answer confirms it. If there is a choice of symbolic refs all pointing to the same revision as HEAD, the client will guess which branch to use.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…