in my project, I usually have a (development) branch leading to the next release version at which point the development branch will be merged into the release branch, and then a new development branch will be created.
This means, two branch HEADs will be pointing to the same commit:
$> cd project.git
$> rgrep release .
./packed-refs:2808f1de3e05bf7fcc509c20f31a93e2ba645bd3 refs/heads/release
$> rgrep 2808f1de3e05bf7fcc509c20f31a93e2ba645bd3 .
./packed-refs:2808f1de3e05bf7fcc509c20f31a93e2ba645bd3 refs/heads/release
./packed-refs:2808f1de3e05bf7fcc509c20f31a93e2ba645bd3 refs/heads/development_0103
I want people who clone from my repo to automatically get a check out of the release branch.
$> cd project.git
$> git symbolic-ref HEAD
refs/heads/release
but, when cloning from that repo apparently people get the alphabetically first matching branch checked out
$> git clone project.git/ project.clone
$> cd project.clone
$> git status
# On branch development_0103
nothing to commit (working directory clean)
It seems to me git is working out the branch name to check out by looking at the SHA1, but not actually using the remote's symbolic-head HEAD.
Is there any way to solve this and make the clone default to 'release' instead of 'development_0103'?