I believe Git is working as designed. You asked it to fetch the empty set of branches, so that’s what it did.
It is slightly confusing that, in the normal non-detached case, ‘git clone’ creates the refs/remotes/origin/HEAD symref pointing to the remote’s default branch; however, even in this case, ‘git fetch’ does not update it.
If you think the design is wrong, you may want to bring this up with the upstream developers.
But I don’t believe that the AOSP repositories have no branches. They look completely normal to me.
I believe Git is working as designed. You asked it to fetch the empty set of branches, so that’s what it did.
It is slightly confusing that, in the normal non-detached case, ‘git clone’ creates the refs/remotes/ origin/ HEAD symref pointing to the remote’s default branch; however, even in this case, ‘git fetch’ does not update it.
If you think the design is wrong, you may want to bring this up with the upstream developers.
But I don’t believe that the AOSP repositories have no branches. They look completely normal to me.
$ git clone https:/ /android. googlesource. com/platform/ packages/ apps/Email origin/ HEAD -> origin/master origin/ donut-release origin/ donut-release2 origin/ eclair- passion- release origin/ master origin/ tools_r20 origin/ tools_r21 origin/ tools_r22 origin/ tools_r22. 2
$ cd Email
$ git branch -a
* master
remotes/
remotes/
remotes/
remotes/
[…]
remotes/
remotes/
remotes/
remotes/
remotes/
I think the answer is that you should not create repositories with no branches.