A bare repository in git does not include a checkout. So in order to set the default branch that users will get after they clone, you cannot use git-checkout mybranch.
Instead, if you want the default branch to be something other than master
, you need to do this:
git symbolic-ref HEAD refs/heads/mybranch
Which will update the HEAD
file in your repository so that it contains:
ref: refs/heads/mybranch
This is well documented in the git-symbolic-ref
manpage but it's not necessarily the first place you'd think of looking.
Add a comment