I have a remote repository http://github.com/fernandezpablo85/Test
This repo has a master branch, but it’s behind two other branches so when I clone it I get this warining:
warning: remote HEAD refers to nonexistent ref, unable to checkout.
And also I don’t get a local master branch (git branch shows nothing).
I can fix the whole thing doing:
git checkout -b master origin/master
But I was wondering why this happens? Is master supposed to be the more advanced branch? Or is there something else wrong with my repo?
1/ No, master is not necessary the most advanced branch. One can publish only to another branch, and then delete that branch…
2/ When that happen, you should select master as the default branch from the admin panel of the github repo, but that is not always possible. See this bug
(the idea is to temporary have two branches, in order to be able to select master as default with the GUI admin panel, and then delete the extra branch)